From 7b29c456b9705494e9b1fb4ee7e9d21bfcdd3957 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 1 Oct 2019 11:47:47 +0100 Subject: [PATCH] Include ending after ellipsis --- content.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/content.py b/content.py index 7b244b541..41ca0a1c8 100644 --- a/content.py +++ b/content.py @@ -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,8 +77,10 @@ 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+=''+linkText+'' + markup+=''+linkText[:40]+'' + markup+='' + else: + markup+=''+linkText+'' replaceDict[w]=markup for url,markup in replaceDict.items(): content=content.replace(url,markup)