From a55b4dbbac65ef083d3af4943243f9b6e092d227 Mon Sep 17 00:00:00 2001 From: ldolse Date: Wed, 17 Nov 2010 13:49:12 +0800 Subject: [PATCH] remove extra line feeds from html comments when sanitizing --- src/calibre/library/comments.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/library/comments.py b/src/calibre/library/comments.py index 83eec89abe..00a6ef55ae 100644 --- a/src/calibre/library/comments.py +++ b/src/calibre/library/comments.py @@ -131,7 +131,8 @@ def comments_to_html(comments): def sanitize_comments_html(html): text = html2text(html) md = markdown.Markdown(safe_mode=True) - return md.convert(text) + cleansed = re.sub('\n+', '', md.convert(text)) + return cleansed def test(): for pat, val in [