Handle newlines when adding tags

master
Bob Mottram 2019-09-05 11:17:58 +01:00
parent 063749a1cb
commit bd79e2e694
1 changed files with 2 additions and 2 deletions

View File

@ -207,7 +207,7 @@ def addHtmlTags(baseDir: str,httpPrefix: str, \
"""
if content.startswith('<p>'):
return content
words=content.replace(',',' ').replace(';',' ').split(' ')
words=content.replace('\n',' --linebreak--').replace(',',' ').replace(';',' ').split(' ')
# add music tag if needed
content=addMusicTag(content,'nowplaying')
@ -265,7 +265,7 @@ def addHtmlTags(baseDir: str,httpPrefix: str, \
content=content.replace(wordStr,replaceStr)
content=addWebLinks(content)
content=content.replace('\n','</p><p>')
content=content.replace(' --linebreak--','</p><p>')
return '<p>'+content+'</p>'
def getMentionsFromHtml(htmlText: str,matchStr="<span class=\"h-card\"><a href=\"") -> []: