From 67cd41100310bddff74d02faf6e1d394430ccfe5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 17 Nov 2010 12:51:52 -0700 Subject: [PATCH] Tweak formatting of comments downloaded from Amazon --- 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 [