From 585735d25b02b2a8daa24184af6c5ab698d8e35b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 11 Jun 2020 10:04:10 +0100 Subject: [PATCH] Link briar addresses --- content.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/content.py b/content.py index 138c985f..631513d9 100644 --- a/content.py +++ b/content.py @@ -129,7 +129,8 @@ def addWebLinks(content: str) -> str: if not ('https://' in content or 'http://' in content or 'i2p://' in content or 'gnunet://' in content or 'gemini://' in content or 'gopher://' in content or - 'hyper://' in content or 'dat://' in content): + 'hyper://' in content or 'dat://' in content or + 'briar:' in content): return content maxLinkLength = 40 @@ -140,6 +141,7 @@ def addWebLinks(content: str) -> str: if w.startswith('https://') or \ w.startswith('http://') or \ w.startswith('i2p://') or \ + w.startswith('briar:') or \ w.startswith('gnunet://') or \ w.startswith('gemini://') or \ w.startswith('gopher://') or \ @@ -165,12 +167,15 @@ def addWebLinks(content: str) -> str: markup += '' elif w.startswith('gopher://'): markup += '' + elif w.startswith('briar:'): + markup += '' linkText = w.replace('https://', '').replace('http://', '') linkText = linkText.replace('dat://', '').replace('i2p://', '') linkText = linkText.replace('gnunet://', '') linkText = linkText.replace('hyper://', '') linkText = linkText.replace('gemini://', '') linkText = linkText.replace('gopher://', '') + linkText = linkText.replace('briar:', '') # prevent links from becoming too long if len(linkText) > maxLinkLength: markup += '' + \