This commit is contained in:
Kovid Goyal 2024-09-18 19:24:35 +05:30
parent 3e31324312
commit cb07b649f2
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -9,7 +9,6 @@ import re
import html5_parser
from lxml.etree import Element as LxmlElement
from calibre import xml_replace_entities
from calibre.ebooks.chardet import strip_encoding_declarations, xml_to_unicode
from calibre.utils.cleantext import clean_xml_chars
from calibre.utils.xml_parse import safe_xml_fromstring
@ -18,7 +17,8 @@ try:
from calibre_extensions.fast_html_entities import replace_all_entities
except ImportError:
def replace_all_entities(raw, keep_xml_entities: bool = False):
xml_replace_entities(raw)
from calibre import xml_replace_entities
return xml_replace_entities(raw)
XHTML_NS = 'http://www.w3.org/1999/xhtml'