Handle . within content when extracting tags

master
Bob Mottram 2019-08-19 12:07:04 +01:00
parent 40805f2ae0
commit 68b2c7632a
1 changed files with 9 additions and 0 deletions

View File

@ -150,6 +150,15 @@ def addHtmlTags(baseDir: str,httpPrefix: str, \
if content.startswith('<p>'):
return content
words=content.replace(',',' ').replace(';',' ')
# remove . for words which are not mentions
wordCtr=0
for wordIndex in range(0,len(words)-1):
wordStr=words[wordIndex]
if wordStr.endswith('.'):
if not wordStr.startswith('@'):
words[wordIndex]=words[wordIndex][:-1]
if wordStr.startsswith('.'):
words[wordIndex]=words[wordIndex][1:]
replaceMentions={}
replaceHashTags={}
replaceEmoji={}