mirror of https://gitlab.com/bashrc2/epicyon
Include ending after ellipsis
parent
3d9398609c
commit
7b29c456b9
|
@ -60,7 +60,6 @@ def addWebLinks(content: str) -> str:
|
||||||
return content
|
return content
|
||||||
|
|
||||||
words=content.replace('\n',' --linebreak-- ').split(' ')
|
words=content.replace('\n',' --linebreak-- ').split(' ')
|
||||||
print(str(words))
|
|
||||||
replaceDict={}
|
replaceDict={}
|
||||||
for w in words:
|
for w in words:
|
||||||
if w.startswith('https://') or \
|
if w.startswith('https://') or \
|
||||||
|
@ -78,8 +77,10 @@ def addWebLinks(content: str) -> str:
|
||||||
linkText=w.replace('https://','').replace('http://','').replace('dat://','')
|
linkText=w.replace('https://','').replace('http://','').replace('dat://','')
|
||||||
# prevent links from becoming too long
|
# prevent links from becoming too long
|
||||||
if len(linkText)>40:
|
if len(linkText)>40:
|
||||||
linkText=linkText[:40]
|
markup+='<span class="ellipsis">'+linkText[:40]+'</span>'
|
||||||
markup+='<span class="ellipsis">'+linkText+'</span></a>'
|
markup+='<span class="invisible">'+linkText[40:]+'</span></a>'
|
||||||
|
else:
|
||||||
|
markup+='<span class="ellipsis">'+linkText+'</span></a>'
|
||||||
replaceDict[w]=markup
|
replaceDict[w]=markup
|
||||||
for url,markup in replaceDict.items():
|
for url,markup in replaceDict.items():
|
||||||
content=content.replace(url,markup)
|
content=content.replace(url,markup)
|
||||||
|
|
Loading…
Reference in New Issue