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.
This commit is contained in:
Lukas Fleischer 2018-04-08 09:33:32 +02:00
parent eccd328d42
commit 2b280ea3d8

View file

@ -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)