From 80936d88a33220b99cf613ade3c63c8769607c29 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 6 May 2020 15:46:27 +0100 Subject: [PATCH] Turn gemini url into links --- content.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content.py b/content.py index da9dc1c9..44af0802 100644 --- a/content.py +++ b/content.py @@ -136,6 +136,7 @@ def addWebLinks(content: str) -> str: if w.startswith('https://') or \ w.startswith('http://') or \ w.startswith('i2p://') or \ + w.startswith('gemini://') or \ w.startswith('dat://'): if w.endswith('.') or w.endswith(';'): w = w[:-1] @@ -149,8 +150,11 @@ def addWebLinks(content: str) -> str: markup += '' elif w.startswith('dat://'): markup += '' + elif w.startswith('gemini://'): + markup += '' linkText = w.replace('https://', '').replace('http://', '') linkText = linkText.replace('dat://', '').replace('i2p://', '') + linkText = linkText.replace('gemini://', '') # prevent links from becoming too long if len(linkText) > maxLinkLength: markup += '' + \