From 93c161e96f812c0ac885de850e0583bd83f6fd13 Mon Sep 17 00:00:00 2001 From: un-pogaz <46523284+un-pogaz@users.noreply.github.com> Date: Mon, 24 Apr 2023 17:55:49 +0200 Subject: [PATCH] fix comments markdown in v4, the switch to QtWebEngine introduced a bug where, in "HTML comments", paragraphs with a single
produced an visual extra gap in the render, problem will have been solved by using non-breaking space

 

(topic https://www.mobileread.com/forums/showthread.php?t=325991) However, the "calibre.library.comments > markdown" still produces HTML with


causing the rendering of "Markdown comments" in Book Details (and Book Info) to still have this extra gap. This commit is to fix this and do a more consistent rendering between "HTML comments" and "Markdown comments" --- 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 fe3853d656..1e312d5b5b 100644 --- a/src/calibre/library/comments.py +++ b/src/calibre/library/comments.py @@ -134,7 +134,8 @@ def markdown(val): except AttributeError: from calibre.ebooks.markdown import Markdown md = markdown.Markdown = Markdown() - return md.convert(val) + val = md.convert(val) + return re.sub(r']*?)>\s*\s*

','\xa0

', val) def merge_comments(one, two):