Fix bug with mistakenly trying to html parse images :)
This commit is contained in:
parent
242030049c
commit
32b57bd849
1 changed files with 7 additions and 2 deletions
|
@ -248,8 +248,13 @@ class Node:
|
||||||
subnodes = []
|
subnodes = []
|
||||||
if other.wikilink in [n.wikilink for n in self.push_nodes()]:
|
if other.wikilink in [n.wikilink for n in self.push_nodes()]:
|
||||||
for subnode in self.subnodes:
|
for subnode in self.subnodes:
|
||||||
|
if subnode.mediatype != 'text/plain':
|
||||||
|
continue
|
||||||
|
try:
|
||||||
# I tried parsing the marko tree but honestly this seemed easier/simpler.
|
# I tried parsing the marko tree but honestly this seemed easier/simpler.
|
||||||
html = render.markdown(subnode.content)
|
html = render.markdown(subnode.content)
|
||||||
|
except AssertionError:
|
||||||
|
breakpoint()
|
||||||
try:
|
try:
|
||||||
tree = lxml.html.fromstring(html)
|
tree = lxml.html.fromstring(html)
|
||||||
except lxml.etree.ParserError:
|
except lxml.etree.ParserError:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue