mirror of https://gitlab.com/bashrc2/epicyon
Also support gopher links
parent
80936d88a3
commit
0f1ad061ec
|
@ -137,6 +137,7 @@ def addWebLinks(content: str) -> str:
|
||||||
w.startswith('http://') or \
|
w.startswith('http://') or \
|
||||||
w.startswith('i2p://') or \
|
w.startswith('i2p://') or \
|
||||||
w.startswith('gemini://') or \
|
w.startswith('gemini://') or \
|
||||||
|
w.startswith('gopher://') or \
|
||||||
w.startswith('dat://'):
|
w.startswith('dat://'):
|
||||||
if w.endswith('.') or w.endswith(';'):
|
if w.endswith('.') or w.endswith(';'):
|
||||||
w = w[:-1]
|
w = w[:-1]
|
||||||
|
@ -152,9 +153,12 @@ def addWebLinks(content: str) -> str:
|
||||||
markup += '<span class="invisible">dat://</span>'
|
markup += '<span class="invisible">dat://</span>'
|
||||||
elif w.startswith('gemini://'):
|
elif w.startswith('gemini://'):
|
||||||
markup += '<span class="invisible">gemini://</span>'
|
markup += '<span class="invisible">gemini://</span>'
|
||||||
|
elif w.startswith('gopher://'):
|
||||||
|
markup += '<span class="invisible">gopher://</span>'
|
||||||
linkText = w.replace('https://', '').replace('http://', '')
|
linkText = w.replace('https://', '').replace('http://', '')
|
||||||
linkText = linkText.replace('dat://', '').replace('i2p://', '')
|
linkText = linkText.replace('dat://', '').replace('i2p://', '')
|
||||||
linkText = linkText.replace('gemini://', '')
|
linkText = linkText.replace('gemini://', '')
|
||||||
|
linkText = linkText.replace('gopher://', '')
|
||||||
# prevent links from becoming too long
|
# prevent links from becoming too long
|
||||||
if len(linkText) > maxLinkLength:
|
if len(linkText) > maxLinkLength:
|
||||||
markup += '<span class="ellipsis">' + \
|
markup += '<span class="ellipsis">' + \
|
||||||
|
|
Loading…
Reference in New Issue