diff --git a/content.py b/content.py index 45e13e00..586e00bc 100644 --- a/content.py +++ b/content.py @@ -30,13 +30,13 @@ def addMusicTag(content: str,tag: str) -> str: def addWebLinks(content: str) -> str: """Adds markup for web links """ - if not ('https://' in content or 'http://' in content): + if not ('https://' in content or 'http://' in content or 'dat://' in content): return content words=content.replace('\n',' --linebreak--').split(' ') replaceDict={} for w in words: - if w.startswith('https://') or w.startswith('http://'): + if w.startswith('https://') or w.startswith('http://') or w.startswith('dat://'): if w.endswith('.') or w.endswith(';'): w=w[:-1] markup='' @@ -44,7 +44,9 @@ def addWebLinks(content: str) -> str: markup+='' elif w.startswith('http://'): markup+='' - markup+=''+w.replace('https://','').replace('http://','')+'' + elif w.startswith('dat://'): + markup+='' + markup+=''+w.replace('https://','').replace('http://','').replace('dat://','')+'' replaceDict[w]=markup for url,markup in replaceDict.items(): content=content.replace(url,markup)