diff mbox

Allow manual breaks and horizontal lines in comments

Message ID 20180408073605.14283-1-lfleischer@archlinux.org
State Accepted, archived
Headers show

Commit Message

Lukas Fleischer April 8, 2018, 7:36 a.m. UTC
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.
---
 aurweb/scripts/rendercomment.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/aurweb/scripts/rendercomment.py b/aurweb/scripts/rendercomment.py
index 4b64227..5e18fd5 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)