diff --git a/app/filters.py b/app/filters.py index 6aadde6..c346c66 100644 --- a/app/filters.py +++ b/app/filters.py @@ -1,5 +1,6 @@ from app import app import hashlib +import markdown @app.template_filter('none_filter') @@ -20,3 +21,8 @@ def md5_filter(value): @app.template_filter('str') def str_filter(value): return str(value) + + +@app.template_filter('markdown') +def md(value): + return markdown.markdown(value) diff --git a/requirements.txt b/requirements.txt index 4fe78c1..947a32f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,3 +3,4 @@ Flask-SQLAlchemy Flask-Security Flask-WTF PyMySQL +markdown