Fix bug with mistakenly trying to html parse images :)

This commit is contained in:
Flancian 2021-01-31 19:06:39 +01:00
parent 242030049c
commit 32b57bd849
1 changed files with 7 additions and 2 deletions

View File

@ -248,8 +248,13 @@ class Node:
subnodes = []
if other.wikilink in [n.wikilink for n in self.push_nodes()]:
for subnode in self.subnodes:
# I tried parsing the marko tree but honestly this seemed easier/simpler.
html = render.markdown(subnode.content)
if subnode.mediatype != 'text/plain':
continue
try:
# I tried parsing the marko tree but honestly this seemed easier/simpler.
html = render.markdown(subnode.content)
except AssertionError:
breakpoint()
try:
tree = lxml.html.fromstring(html)
except lxml.etree.ParserError: