forked from indymedia/epicyon
master
parent
1cbf264e37
commit
828ed9f9e8
|
@ -19,7 +19,7 @@ def addWebLinks(content: str) -> str:
|
||||||
words=content.split(' ')
|
words=content.split(' ')
|
||||||
replaceDict={}
|
replaceDict={}
|
||||||
for w in words:
|
for w in words:
|
||||||
if w.startswith('http://') or w.startswith('http://'):
|
if w.startswith('https://') or w.startswith('http://'):
|
||||||
if w.endswith('.') or w.endswith(';'):
|
if w.endswith('.') or w.endswith(';'):
|
||||||
w=w[:-1]
|
w=w[:-1]
|
||||||
markup='<a href="'+w+'" rel="nofollow noopener" target="_blank">'
|
markup='<a href="'+w+'" rel="nofollow noopener" target="_blank">'
|
||||||
|
@ -243,8 +243,8 @@ def addHtmlTags(baseDir: str,httpPrefix: str, \
|
||||||
for wordStr,replaceStr in replaceEmoji.items():
|
for wordStr,replaceStr in replaceEmoji.items():
|
||||||
content=content.replace(wordStr,replaceStr)
|
content=content.replace(wordStr,replaceStr)
|
||||||
|
|
||||||
content=content.replace('\n','</p><p>')
|
|
||||||
content=addWebLinks(content)
|
content=addWebLinks(content)
|
||||||
|
content=content.replace('\n','</p><p>')
|
||||||
return '<p>'+content+'</p>'
|
return '<p>'+content+'</p>'
|
||||||
|
|
||||||
def getMentionsFromHtml(htmlText: str,matchStr="<span class=\"h-card\"><a href=\"") -> []:
|
def getMentionsFromHtml(htmlText: str,matchStr="<span class=\"h-card\"><a href=\"") -> []:
|
||||||
|
|
Loading…
Reference in New Issue