gemtext: auto-close preformatted blocks

The spec does not say if preformatted text should be rendered or not if
the file stops before the closing fence is found. The wording makes me
think it is more adequate to auto-close the block in this case.
exec
dece 3 years ago
parent fef350804c
commit 0c786087ea

@ -94,4 +94,9 @@ def parse_gemtext(text: str):
else:
elements.append(Paragraph(line))
# If a preformatted block is not closed before the file ends, consider it
# closed anyway; the spec does not seem to talk about that case.
if preformatted:
elements.append(preformatted)
return elements

Loading…
Cancel
Save