From 0f1ad061ecb1c611e79d839cc9d48c1980aee31a Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 6 May 2020 16:15:03 +0100 Subject: [PATCH] Also support gopher links --- content.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content.py b/content.py index 44af0802d..0d6d655f6 100644 --- a/content.py +++ b/content.py @@ -137,6 +137,7 @@ def addWebLinks(content: str) -> str: w.startswith('http://') or \ w.startswith('i2p://') or \ w.startswith('gemini://') or \ + w.startswith('gopher://') or \ w.startswith('dat://'): if w.endswith('.') or w.endswith(';'): w = w[:-1] @@ -152,9 +153,12 @@ def addWebLinks(content: str) -> str: markup += '' elif w.startswith('gemini://'): markup += '' + elif w.startswith('gopher://'): + markup += '' linkText = w.replace('https://', '').replace('http://', '') linkText = linkText.replace('dat://', '').replace('i2p://', '') linkText = linkText.replace('gemini://', '') + linkText = linkText.replace('gopher://', '') # prevent links from becoming too long if len(linkText) > maxLinkLength: markup += '' + \