diff options
author | ubq323 <ubq323> | 2021-06-25 19:37:09 +0000 |
---|---|---|
committer | ubq323 <ubq323> | 2021-06-25 19:37:09 +0000 |
commit | 0133b7b7ee1bcde5cd63c48fdb0af25dfb1ffd00 (patch) | |
tree | 146ef94c948da951f06973be67e69766c5585243 /apioforum/mdrender.py | |
parent | d1bb2fa1b24ecaa54e1a9fc0cfd95aaa9a4907c9 (diff) |
allowify even more html tags
Diffstat (limited to 'apioforum/mdrender.py')
-rw-r--r-- | apioforum/mdrender.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/apioforum/mdrender.py b/apioforum/mdrender.py index 5f1192b..7dbbf6b 100644 --- a/apioforum/mdrender.py +++ b/apioforum/mdrender.py @@ -14,7 +14,11 @@ allowed_tags = [ 'mark', 'img', 'marquee', - 'pulsate' + 'pulsate', + 'sup','sub', + 'table','thead','tbody','tr','th','td', + 'details','summary', + ] allowed_tags += csscolors @@ -22,7 +26,9 @@ allowed_tags += ("mark" + c for c in csscolors) allowed_attributes = bleach.sanitizer.ALLOWED_ATTRIBUTES.copy() allowed_attributes.update( - img='src' + img=['src','alt','title'], + ol=['start'], + details=['open'], ) allowed_tags.extend(bleach.sanitizer.ALLOWED_TAGS) @@ -30,7 +36,12 @@ allowed_tags.extend(bleach.sanitizer.ALLOWED_TAGS) cleaner = bleach.sanitizer.Cleaner(tags=allowed_tags,attributes=allowed_attributes) import markdown -md = markdown.Markdown(extensions=['pymdownx.tilde','fenced_code']) +md = markdown.Markdown(extensions=[ + 'pymdownx.tilde', + 'fenced_code', + 'tables', + 'pymdownx.details', +]) def render(text): text = md.reset().convert(text) |