Replaced markdown with commonmark module

This commit is contained in:
Sybren A. Stüvel 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 from __future__ import absolute_import
import bleach import bleach
import markdown as _markdown import CommonMark
ALLOWED_TAGS = [ ALLOWED_TAGS = [
'a', 'a',
@ -36,7 +36,7 @@ ALLOWED_STYLES = [
def markdown(s): def markdown(s):
tainted_html = _markdown.markdown(s) tainted_html = CommonMark.commonmark(s)
safe_html = bleach.clean(tainted_html, safe_html = bleach.clean(tainted_html,
tags=ALLOWED_TAGS, tags=ALLOWED_TAGS,
attributes=ALLOWED_ATTRIBUTES, attributes=ALLOWED_ATTRIBUTES,

View File

@ -7,6 +7,7 @@ blinker==1.4
bugsnag==2.3.1 bugsnag==2.3.1
bleach==1.4.3 bleach==1.4.3
Cerberus==0.9.2 Cerberus==0.9.2
commonmark==0.7.2
Eve==0.6.3 Eve==0.6.3
Events==0.2.1 Events==0.2.1
Flask==0.10.1 Flask==0.10.1
@ -20,7 +21,6 @@ google-apitools==0.4.11
httplib2==0.9.2 httplib2==0.9.2
idna==2.0 idna==2.0
MarkupSafe==0.23 MarkupSafe==0.23
markdown==2.6.7
ndg-httpsclient==0.4.0 ndg-httpsclient==0.4.0
Pillow==2.8.1 Pillow==2.8.1
pycparser==2.14 pycparser==2.14
@ -50,6 +50,7 @@ cookies==2.2.1
cryptography==1.3.1 cryptography==1.3.1
enum34==1.1.3 enum34==1.1.3
funcsigs==1.0.1 funcsigs==1.0.1
future==0.15.2
html5lib==0.9999999 html5lib==0.9999999
googleapis-common-protos==1.1.0 googleapis-common-protos==1.1.0
ipaddress==1.0.16 ipaddress==1.0.16