diff --git a/content.py b/content.py
index 703a2bc0f..15b53105f 100644
--- a/content.py
+++ b/content.py
@@ -59,6 +59,7 @@ def addWebLinks(content: str) -> str:
if not ('https://' in content or 'http://' in content):
return content
+ maxLinkLength=40
words=content.replace('\n',' --linebreak-- ').split(' ')
replaceDict={}
for w in words:
@@ -76,9 +77,9 @@ def addWebLinks(content: str) -> str:
markup+='dat://'
linkText=w.replace('https://','').replace('http://','').replace('dat://','')
# prevent links from becoming too long
- if len(linkText)>40:
- markup+=''+linkText[:40]+''
- markup+=''+linkText[40:]+''
+ if len(linkText)>maxLinkLength:
+ markup+=''+linkText[:maxLinkLength]+''
+ markup+=''+linkText[maxLinkLength:]+''
else:
markup+=''+linkText+''
replaceDict[w]=markup