summaryrefslogtreecommitdiffstats
path: root/python/fatcat_web
diff options
context:
space:
mode:
Diffstat (limited to 'python/fatcat_web')
-rw-r--r--python/fatcat_web/__init__.py9
-rw-r--r--python/fatcat_web/templates/editgroup_view.html3
2 files changed, 11 insertions, 1 deletions
diff --git a/python/fatcat_web/__init__.py b/python/fatcat_web/__init__.py
index 7d62bb5f..bd0a1888 100644
--- a/python/fatcat_web/__init__.py
+++ b/python/fatcat_web/__init__.py
@@ -4,6 +4,7 @@ from flask_uuid import FlaskUUID
from flask_debugtoolbar import DebugToolbarExtension
from flask_login import LoginManager
from flask_wtf.csrf import CSRFProtect
+from flask_misaka import Misaka
from authlib.flask.client import OAuth
from loginpass import create_flask_blueprint, Gitlab
from raven.contrib.flask import Sentry
@@ -19,6 +20,14 @@ toolbar = DebugToolbarExtension(app)
FlaskUUID(app)
app.csrf = CSRFProtect(app)
+# This is the Markdown processor; setting default here
+Misaka(app,
+ autolink=True,
+ no_intra_emphasis=True,
+ strikethrough=True,
+ escape=True,
+)
+
login_manager = LoginManager()
login_manager.init_app(app)
login_manager.login_view = "/auth/login"
diff --git a/python/fatcat_web/templates/editgroup_view.html b/python/fatcat_web/templates/editgroup_view.html
index 2f61671d..31f9026f 100644
--- a/python/fatcat_web/templates/editgroup_view.html
+++ b/python/fatcat_web/templates/editgroup_view.html
@@ -124,7 +124,7 @@ reviewable bundle.
</div>
{% endif %}
<div class="ui bottom attached segment">
- {{ annotation.comment_markdown }}
+ {{ annotation.comment_markdown|markdown(escape=True) }}
</div>
</div>
{% else %}
@@ -139,6 +139,7 @@ reviewable bundle.
<div class="field">
<textarea rows="2" name="comment_markdown" required type="text" value=""></textarea>
</div>
+ <i>Markdown is allowed</i>
<button class="ui right floated primary button">
<i class="icon edit"></i> Submit
</button>