EPUB Input: Workaround for invalid EPUBs produced by someone named 'ibooks, Inc.'. Fixes #744122 (Conversion of epub failed)

This commit is contained in:
Kovid Goyal 2011-03-28 08:46:21 -06:00
parent e6cb34d600
commit 517a8d82cd

View File

@ -103,8 +103,8 @@ class OEBReader(object):
data = self.oeb.container.read(None) data = self.oeb.container.read(None)
data = self.oeb.decode(data) data = self.oeb.decode(data)
data = XMLDECL_RE.sub('', data) data = XMLDECL_RE.sub('', data)
data = data.replace('http://openebook.org/namespaces/oeb-package/1.0', data = re.sub(r'http://openebook.org/namespaces/oeb-package/1.0(/*)',
OPF1_NS) OPF1_NS, data)
try: try:
opf = etree.fromstring(data) opf = etree.fromstring(data)
except etree.XMLSyntaxError: except etree.XMLSyntaxError: