summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2018-04-08 09:33:32 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2018-04-08 09:33:35 +0200
commit2b280ea3d864d80da1a49c982867d261ec865e43 (patch)
tree555e24d387c9ff7a0e4de4b50bcf00a9acff7ff5
parenteccd328d428cbe1445118d24b1bf789c5b3b83c9 (diff)
downloadaur-2b280ea3d864d80da1a49c982867d261ec865e43.tar.gz
aur-2b280ea3d864d80da1a49c982867d261ec865e43.tar.xz
Allow manual breaks and horizontal lines in comments
When sanitizing rendered comments, keep <hr> tags and <br> tags. The former are generated when using "---" in Markdown comments, the latter are used when putting two spaces at the end of a line. Fixes FS#56649.
-rwxr-xr-xaurweb/scripts/rendercomment.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/aurweb/scripts/rendercomment.py b/aurweb/scripts/rendercomment.py
index 4b642273..5e18fd59 100755
--- a/aurweb/scripts/rendercomment.py
+++ b/aurweb/scripts/rendercomment.py
@@ -119,8 +119,8 @@ def main():
FlysprayLinksExtension(),
GitCommitsExtension(pkgbase),
HeadingExtension()])
- allowed_tags = bleach.sanitizer.ALLOWED_TAGS + \
- ['p', 'pre', 'h4', 'h5', 'h6']
+ allowed_tags = (bleach.sanitizer.ALLOWED_TAGS +
+ ['p', 'pre', 'h4', 'h5', 'h6', 'br', 'hr'])
html = bleach.clean(html, tags=allowed_tags)
save_rendered_comment(conn, commentid, html)