mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
ae735b2ea3
commit
042d740593
@ -24,7 +24,7 @@ def html2text(html):
|
||||
import re
|
||||
if isinstance(html, bytes):
|
||||
from calibre.ebooks.chardet import xml_to_unicode
|
||||
html = xml_to_unicode(html, strip_encoding_pats=True, resolve_entities=True)
|
||||
html = xml_to_unicode(html, strip_encoding_pats=True, resolve_entities=True)[0]
|
||||
# replace <u> tags with <span> as <u> becomes emphasis in html2text
|
||||
html = re.sub(
|
||||
r'<\s*(?P<solidus>/?)\s*[uU]\b(?P<rest>[^>]*)>',
|
||||
|
Loading…
x
Reference in New Issue
Block a user