Update markdown
This commit is contained in:
parent
75b04140f3
commit
f768a20b97
1 changed files with 1 additions and 4 deletions
|
@ -52,17 +52,14 @@ ALLOWED_TAGS = bleach.sanitizer.ALLOWED_TAGS + [
|
||||||
"summary"
|
"summary"
|
||||||
]
|
]
|
||||||
|
|
||||||
ALLOWED_ATTRS = ["src", "width", "height", "href", "class"]
|
ALLOWED_ATTRS = ["src", "width", "height", "href", "class", "open"]
|
||||||
|
|
||||||
|
|
||||||
@registry.filter
|
@registry.filter
|
||||||
def markdown(value):
|
def markdown(value):
|
||||||
print("BEFORE:", value)
|
|
||||||
extensions = EXTENSIONS
|
extensions = EXTENSIONS
|
||||||
html = _markdown.markdown(value, extensions=extensions)
|
html = _markdown.markdown(value, extensions=extensions)
|
||||||
html = bleach.clean(html, tags=ALLOWED_TAGS, attributes=ALLOWED_ATTRS)
|
html = bleach.clean(html, tags=ALLOWED_TAGS, attributes=ALLOWED_ATTRS)
|
||||||
if not html:
|
if not html:
|
||||||
html = escape(value)
|
html = escape(value)
|
||||||
print("AFTER")
|
|
||||||
print(html)
|
|
||||||
return '<div class="md-typeset">%s</div>' % html
|
return '<div class="md-typeset">%s</div>' % html
|
||||||
|
|
Loading…
Reference in a new issue