mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Support fenced code in package comments
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
362ee754e7
commit
fd880a7a84
1 changed files with 3 additions and 2 deletions
|
@ -86,9 +86,10 @@ def main():
|
||||||
conn = aurweb.db.Connection()
|
conn = aurweb.db.Connection()
|
||||||
|
|
||||||
text, pkgbase = get_comment(conn, commentid)
|
text, pkgbase = get_comment(conn, commentid)
|
||||||
html = markdown.markdown(text, extensions=[LinkifyExtension(),
|
html = markdown.markdown(text, extensions=['fenced_code',
|
||||||
|
LinkifyExtension(),
|
||||||
GitCommitsExtension(pkgbase)])
|
GitCommitsExtension(pkgbase)])
|
||||||
allowed_tags = bleach.sanitizer.ALLOWED_TAGS + ['p']
|
allowed_tags = bleach.sanitizer.ALLOWED_TAGS + ['p', 'pre']
|
||||||
html = bleach.clean(html, tags=allowed_tags)
|
html = bleach.clean(html, tags=allowed_tags)
|
||||||
save_rendered_comment(conn, commentid, html)
|
save_rendered_comment(conn, commentid, html)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue