From f59eb08b1435d3b6444f9f6f49c008c1eecdf8ff Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 19 Aug 2019 12:14:38 +0100 Subject: [PATCH] Create word array --- content.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/content.py b/content.py index d5a46178..52fdaeba 100644 --- a/content.py +++ b/content.py @@ -150,15 +150,20 @@ def addHtmlTags(baseDir: str,httpPrefix: str, \ if content.startswith('

'): return content words=content.replace(',',' ').replace(';',' ') + # remove . for words which are not mentions wordCtr=0 + newWords=[] for wordIndex in range(0,len(words)-1): wordStr=words[wordIndex] if wordStr.endswith('.'): if not wordStr.startswith('@'): - words[wordIndex]=wordStr[:-1] + wordStr=wordStr[:-1] if wordStr.startswith('.'): - words[wordIndex]=wordStr[1:] + wordStr=wordStr[1:] + newWords.append(wordStr) + words=newWords + replaceMentions={} replaceHashTags={} replaceEmoji={}