mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
fix comments markdown
in v4, the switch to QtWebEngine introduced a bug where, in "HTML comments", paragraphs with a single <br> produced an visual extra gap in the render, problem will have been solved by using non-breaking space <p> </p> (topic https://www.mobileread.com/forums/showthread.php?t=325991) However, the "calibre.library.comments > markdown" still produces HTML with <p><br></p> 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"
This commit is contained in:
parent
259a8555db
commit
93c161e96f
@ -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'<p(|\s+[^>]*?)>\s*<br\s*/?>\s*</p>','<p\\1>\xa0</p>', val)
|
||||
|
||||
|
||||
def merge_comments(one, two):
|
||||
|
Loading…
x
Reference in New Issue
Block a user