From 32b57bd8494fdb9d6ae3a68843aef1e52264e792 Mon Sep 17 00:00:00 2001 From: Flancian <0@flancia.org> Date: Sun, 31 Jan 2021 19:06:39 +0100 Subject: [PATCH] Fix bug with mistakenly trying to html parse images :) --- app/db.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/db.py b/app/db.py index b121753..220280a 100644 --- a/app/db.py +++ b/app/db.py @@ -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: