Handle preformatted content.
This commit is contained in:
parent
fea4bc3757
commit
eca985da3e
|
@ -86,8 +86,13 @@ while True:
|
||||||
# Handle a Gemini map
|
# Handle a Gemini map
|
||||||
if mime == "text/gemini":
|
if mime == "text/gemini":
|
||||||
menu = []
|
menu = []
|
||||||
|
preformatted = False
|
||||||
for line in body.splitlines():
|
for line in body.splitlines():
|
||||||
if line.startswith("=>") and line[2:].strip():
|
if line.startswith("```"):
|
||||||
|
preformatted = not preformatted
|
||||||
|
elif preformatted:
|
||||||
|
print(line)
|
||||||
|
elif line.startswith("=>") and line[2:].strip():
|
||||||
bits = line[2:].strip().split(maxsplit=1)
|
bits = line[2:].strip().split(maxsplit=1)
|
||||||
link_url = bits[0]
|
link_url = bits[0]
|
||||||
link_url = absolutise_url(url, link_url)
|
link_url = absolutise_url(url, link_url)
|
||||||
|
|
Loading…
Reference in New Issue