Remove endings from hashtags

merge-requests/30/head
Bob Mottram 2021-02-13 12:12:06 +00:00
parent 03c234eac9
commit ab6994329a
1 changed files with 6 additions and 0 deletions

View File

@ -788,6 +788,12 @@ def addHtmlTags(baseDir: str, httpPrefix: str,
prevWordStr = ''
continue
elif firstChar == '#':
# remove any endings from the hashtag
hashTagEndings = ('.', ':', ';', '-', '\n')
for ending in hashTagEndings:
if wordStr.endswith(ending):
wordStr = wordStr.replace(ending, '')
if _addHashTags(wordStr, httpPrefix, originalDomain,
replaceHashTags, hashtags):
prevWordStr = ''