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
|
||||
|
||||
words=content.replace('\n',' --linebreak-- ').split(' ')
|
||||
print(str(words))
|
||||
replaceDict={}
|
||||
for w in words:
|
||||
if w.startswith('https://') or \
|
||||
|
@ -78,7 +77,9 @@ def addWebLinks(content: str) -> str:
|
|||
linkText=w.replace('https://','').replace('http://','').replace('dat://','')
|
||||
# prevent links from becoming too long
|
||||
if len(linkText)>40:
|
||||
linkText=linkText[:40]
|
||||
markup+='<span class="ellipsis">'+linkText[:40]+'</span>'
|
||||
markup+='<span class="invisible">'+linkText[40:]+'</span></a>'
|
||||
else:
|
||||
markup+='<span class="ellipsis">'+linkText+'</span></a>'
|
||||
replaceDict[w]=markup
|
||||
for url,markup in replaceDict.items():
|
||||
|
|
Loading…
Reference in New Issue