Replaced markdown with commonmark module

This commit is contained in:
2016-10-20 13:01:43 +02:00
parent db2680be81
commit 8352fafd21
2 changed files with 4 additions and 3 deletions

View File

@@ -6,7 +6,7 @@ This is for user-generated stuff, like comments.
from __future__ import absolute_import
import bleach
import markdown as _markdown
import CommonMark
ALLOWED_TAGS = [
'a',
@@ -36,7 +36,7 @@ ALLOWED_STYLES = [
def markdown(s):
tainted_html = _markdown.markdown(s)
tainted_html = CommonMark.commonmark(s)
safe_html = bleach.clean(tainted_html,
tags=ALLOWED_TAGS,
attributes=ALLOWED_ATTRIBUTES,