diff --git a/src/calibre/library/comments.py b/src/calibre/library/comments.py index 9fc14d9c0d..fe3853d656 100644 --- a/src/calibre/library/comments.py +++ b/src/calibre/library/comments.py @@ -143,7 +143,7 @@ def merge_comments(one, two): def sanitize_comments_html(html): from calibre.ebooks.markdown import Markdown - text = html2text(html) + text = html2text(html, single_line_break=False) md = Markdown() html = md.convert(text) return html diff --git a/src/calibre/utils/html2text.py b/src/calibre/utils/html2text.py index e7a6d1dd13..82abab99e8 100644 --- a/src/calibre/utils/html2text.py +++ b/src/calibre/utils/html2text.py @@ -2,7 +2,7 @@ # License: GPLv3 Copyright: 2019, Kovid Goyal -def html2text(html): +def html2text(html, single_line_break=True): from html2text import HTML2Text import re if isinstance(html, bytes): @@ -15,7 +15,7 @@ def html2text(html): h2t = HTML2Text() h2t.default_image_alt = _('Unnamed image') h2t.body_width = 0 - h2t.single_line_break = True + h2t.single_line_break = single_line_break h2t.emphasis_mark = '*' return h2t.handle(html)