From 19e064f23252497292eed7f0ae31369fda8efa44 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 21 Jul 2018 19:32:05 +0200 Subject: [PATCH] Use markdown2 instead of markdown Adds support for quotes, blockquotes, spoilers and tables --- requirements.txt | 2 +- webserver.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 674fc723..ae9497aa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,4 +9,4 @@ PyNaCl async_timeout raven bcrypt -markdown \ No newline at end of file +markdown2 diff --git a/webserver.py b/webserver.py index b2005558..e51d70f6 100644 --- a/webserver.py +++ b/webserver.py @@ -3,7 +3,7 @@ from flask import session as fl_session import db import bcrypt import configparser -import markdown +import markdown2 import datetime import telegram @@ -176,7 +176,8 @@ def page_wiki(key: str): db_session.close() if wiki_page is None: return render_template("wiki.html", key=key) - converted_md = Markup(markdown.markdown(escape(wiki_page.content), output_format="html5")) + converted_md = Markup(markdown2.markdown(escape(wiki_page.content), output_format="html5"), + extras=["spoiler", "tables"]) return render_template("wiki.html", key=key, wiki_page=wiki_page, converted_md=converted_md, wiki_log=wiki_latest_edit) elif request.method == "POST":