mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
remove extra line feeds from html comments when sanitizing
This commit is contained in:
parent
26ba75f76c
commit
a55b4dbbac
@ -131,7 +131,8 @@ def comments_to_html(comments):
|
|||||||
def sanitize_comments_html(html):
|
def sanitize_comments_html(html):
|
||||||
text = html2text(html)
|
text = html2text(html)
|
||||||
md = markdown.Markdown(safe_mode=True)
|
md = markdown.Markdown(safe_mode=True)
|
||||||
return md.convert(text)
|
cleansed = re.sub('\n+', '', md.convert(text))
|
||||||
|
return cleansed
|
||||||
|
|
||||||
def test():
|
def test():
|
||||||
for pat, val in [
|
for pat, val in [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user