[1/2] Do not keep line breaks in comments

Message ID 20170424155923.30790-1-lfleischer@archlinux.org
State Accepted, archived
Headers show
Series [1/2] Do not keep line breaks in comments | expand

Commit Message

Lukas Fleischer April 24, 2017, 3:59 p.m. UTC
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>
---
 aurweb/scripts/rendercomment.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/aurweb/scripts/rendercomment.py b/aurweb/scripts/rendercomment.py
index 659e18a..c23ef8d 100755
--- a/aurweb/scripts/rendercomment.py
+++ b/aurweb/scripts/rendercomment.py
@@ -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)