From 68b2c7632aba877b16216c4fba68b650dfb89c00 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 19 Aug 2019 12:07:04 +0100 Subject: [PATCH] Handle . within content when extracting tags --- content.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/content.py b/content.py index b8353cee..f824d575 100644 --- a/content.py +++ b/content.py @@ -150,6 +150,15 @@ def addHtmlTags(baseDir: str,httpPrefix: str, \ if content.startswith('

'): 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={}