From 95dface9e7cd2956d0fd4a9b9041fca61afa4fe5 Mon Sep 17 00:00:00 2001 From: jwansek Date: Sun, 18 Apr 2021 16:04:17 +0100 Subject: added linking to markdown images --- parser.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'parser.py') diff --git a/parser.py b/parser.py index 1ba94cd..9071a11 100755 --- a/parser.py +++ b/parser.py @@ -33,9 +33,13 @@ class HighlighterRenderer(misaka.SaferHtmlRenderer): out = '\n
' for line in houdini.escape_html(content.strip()).split("\n"): out += '\n{}
'.format(line) - print(out) return out + '\n
' + def image(self, link, title, alt): + return "%s" % ( + urlparse(link)._replace(query='').geturl(), alt, link + ) + def get_thought_from_id(db, id_): category_name, title, dt, markdown = db.get_thought(id_) return category_name, title, dt, parse_text(markdown) -- cgit v1.2.3