mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 13:05:04 +02:00
...
This commit is contained in:
parent
8f08d9446d
commit
f7a44c80f8
1 changed files with 2 additions and 1 deletions
|
|
@ -24,6 +24,7 @@
|
|||
urlnormalize, BINARY_MIME, \
|
||||
OEBError, OEBBook, DirContainer
|
||||
from calibre.ebooks.oeb.writer import OEBWriter
|
||||
from calibre.utils.cleantext import clean_xml_chars
|
||||
from calibre.utils.localization import get_lang
|
||||
from calibre.ptempfile import TemporaryDirectory
|
||||
from calibre.constants import __appname__, __version__
|
||||
|
|
@ -106,7 +107,7 @@ def _read_opf(self):
|
|||
try:
|
||||
opf = etree.fromstring(data)
|
||||
except etree.XMLSyntaxError:
|
||||
data = xml_replace_entities(data, encoding=None)
|
||||
data = xml_replace_entities(clean_xml_chars(data), encoding=None)
|
||||
try:
|
||||
opf = etree.fromstring(data)
|
||||
self.logger.warn('OPF contains invalid HTML named entities')
|
||||
|
|
|
|||
Loading…
Reference in a new issue