mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
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 <lfleischer@archlinux.org>
This commit is contained in:
parent
136171e509
commit
362ee754e7
2 changed files with 3 additions and 3 deletions
|
@ -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 &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue