summaryrefslogtreecommitdiffstats
path: root/aurweb/scripts
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2017-04-24 17:42:37 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2017-04-24 21:10:02 +0200
commitfd880a7a84f6d644bf220199f69da3738f2672cb (patch)
tree7d714f999e06ee60e9ebfe19a78cf16b104a7571 /aurweb/scripts
parent362ee754e7d28c36f74b7feee03e529a380dd379 (diff)
downloadaur-fd880a7a84f6d644bf220199f69da3738f2672cb.tar.gz
aur-fd880a7a84f6d644bf220199f69da3738f2672cb.tar.xz
Support fenced code in package comments
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'aurweb/scripts')
-rwxr-xr-xaurweb/scripts/rendercomment.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/aurweb/scripts/rendercomment.py b/aurweb/scripts/rendercomment.py
index c23ef8de..f32c8274 100755
--- a/aurweb/scripts/rendercomment.py
+++ b/aurweb/scripts/rendercomment.py
@@ -86,9 +86,10 @@ def main():
conn = aurweb.db.Connection()
text, pkgbase = get_comment(conn, commentid)
- html = markdown.markdown(text, extensions=[LinkifyExtension(),
+ html = markdown.markdown(text, extensions=['fenced_code',
+ LinkifyExtension(),
GitCommitsExtension(pkgbase)])
- allowed_tags = bleach.sanitizer.ALLOWED_TAGS + ['p']
+ allowed_tags = bleach.sanitizer.ALLOWED_TAGS + ['p', 'pre']
html = bleach.clean(html, tags=allowed_tags)
save_rendered_comment(conn, commentid, html)