mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Add a comment explaining why we regex the markdown output
This commit is contained in:
parent
8d6b2750b8
commit
cfe2ff3c4b
@ -135,6 +135,8 @@ def markdown(val):
|
||||
from calibre.ebooks.markdown import Markdown
|
||||
md = markdown.Markdown = Markdown()
|
||||
val = md.convert(val)
|
||||
# The Qt Rich text widgets display <p><br></p> as two blank lines instead
|
||||
# of one so fix that here.
|
||||
return re.sub(r'<p(|\s+[^>]*?)>\s*<br\s*/?>\s*</p>','<p\\1>\xa0</p>', val)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user