Commit 362ee754 authored by Lukas Fleischer's avatar Lukas Fleischer
Browse files

Do not keep line breaks in comments



With the new Markdown support, text paragraphs are now properly
converted to HTML paragraphs, so we no longer need to keep line breaks.
Signed-off-by: Lukas Fleischer's avatarLukas Fleischer <lfleischer@archlinux.org>
parent 136171e5
......@@ -86,9 +86,9 @@ def main():
conn = aurweb.db.Connection()
text, pkgbase = get_comment(conn, commentid)
html = markdown.markdown(text, extensions=['nl2br', LinkifyExtension(),
html = markdown.markdown(text, extensions=[LinkifyExtension(),
GitCommitsExtension(pkgbase)])
allowed_tags = bleach.sanitizer.ALLOWED_TAGS + ['p', 'br']
allowed_tags = bleach.sanitizer.ALLOWED_TAGS + ['p']
html = bleach.clean(html, tags=allowed_tags)
save_rendered_comment(conn, commentid, html)
......
......@@ -12,7 +12,7 @@ test_expect_success 'Test comment rendering.' '
EOD
"$RENDERCOMMENT" 1 &&
cat <<-EOD >expected &&
<p>Hello world!<br>
<p>Hello world!
This is a comment.</p>
EOD
cat <<-EOD | sqlite3 aur.db >actual &&
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment