improve handling of nested <pre>

This commit is contained in:
Lionel Dricot 2022-01-14 11:28:30 +01:00
parent 5ad8dd61e7
commit 456095bd07
1 changed files with 5 additions and 2 deletions

View File

@ -1116,10 +1116,13 @@ you'll be able to transparently follow links to Gopherspace!""")
else:
rendered_body += "\n" + "\x1b[34m\x1b[2m" + line + "\x1b[0m" + "\n"
elif element.name == "pre":
rendered_body += "\n"
if element.string:
rendered_body += "\n"
rendered_body += element.string
rendered_body += "\n"
else:
for child in element.children:
rendered_body += recursive_render(child,indent=indent)
rendered_body += "\n"
elif element.name == "li":
line = ""
for child in element.children: