diff --git a/content.py b/content.py
index 7fb04c8a..7b244b54 100644
--- a/content.py
+++ b/content.py
@@ -59,7 +59,8 @@ def addWebLinks(content: str) -> str:
if not ('https://' in content or 'http://' in content):
return content
- words=content.replace('\n',' --linebreak--').split(' ')
+ words=content.replace('\n',' --linebreak-- ').split(' ')
+ print(str(words))
replaceDict={}
for w in words:
if w.startswith('https://') or \
@@ -76,13 +77,13 @@ def addWebLinks(content: str) -> str:
markup+='dat://'
linkText=w.replace('https://','').replace('http://','').replace('dat://','')
# prevent links from becoming too long
- if len(linkText)>50:
- linkText=linkText[:50]
+ if len(linkText)>40:
+ linkText=linkText[:40]
markup+=''+linkText+''
replaceDict[w]=markup
for url,markup in replaceDict.items():
content=content.replace(url,markup)
- content=content.replace(' --linebreak--','
')
+ content=content.replace(' --linebreak-- ','
')
return content
def validHashTag(hashtag: str) -> bool:
diff --git a/tests.py b/tests.py
index 802190fe..8c0f4065 100644
--- a/tests.py
+++ b/tests.py
@@ -1381,6 +1381,9 @@ def testWebLinks():
exampleText='This post has a web links https://somesite.net\n\nAnd some other text'
linkedText=addWebLinks(exampleText)
assert 'https://somesite.net