mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
ad2ffc8fe2
commit
d68ecaf264
@ -12,7 +12,6 @@ from calibre.ebooks.BeautifulSoup import BeautifulSoup, Tag, NavigableString, \
|
||||
CData, Comment, Declaration, ProcessingInstruction
|
||||
from calibre import prepare_string_for_xml
|
||||
from calibre.utils.html2text import html2text
|
||||
from calibre.ebooks.markdown import Markdown
|
||||
|
||||
# Hackish - ignoring sentences ending or beginning in numbers to avoid
|
||||
# confusion with decimal points.
|
||||
@ -135,6 +134,7 @@ def merge_comments(one, two):
|
||||
return comments_to_html(one) + '\n\n' + comments_to_html(two)
|
||||
|
||||
def sanitize_comments_html(html):
|
||||
from calibre.ebooks.markdown import Markdown
|
||||
text = html2text(html)
|
||||
md = Markdown(safe_mode='remove')
|
||||
cleansed = re.sub('\n+', '', md.convert(text))
|
||||
|
Loading…
x
Reference in New Issue
Block a user