mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
lit-meta shouldn't fail on invalid OPF files, instead it should do its best and trust the XML parser to correct any mistakes.
This commit is contained in:
parent
d897f81d2b
commit
b57f163056
@ -167,7 +167,7 @@ class UnBinary(object):
|
|||||||
self.buf = cStringIO.StringIO()
|
self.buf = cStringIO.StringIO()
|
||||||
self.ampersands = []
|
self.ampersands = []
|
||||||
self.binary_to_text()
|
self.binary_to_text()
|
||||||
self.raw = self.buf.getvalue().lstrip().decode('utf-8')
|
self.raw = self.buf.getvalue().lstrip().decode('utf-8')
|
||||||
self.escape_ampersands()
|
self.escape_ampersands()
|
||||||
|
|
||||||
def escape_ampersands(self):
|
def escape_ampersands(self):
|
||||||
@ -267,8 +267,8 @@ class UnBinary(object):
|
|||||||
|
|
||||||
self.buf.write(unicode(tag_name).encode('utf-8'))
|
self.buf.write(unicode(tag_name).encode('utf-8'))
|
||||||
elif flags & FLAG_CLOSING:
|
elif flags & FLAG_CLOSING:
|
||||||
if depth == 0:
|
#if depth == 0:
|
||||||
raise LitReadError('Extra closing tag')
|
# raise LitReadError('Extra closing tag')
|
||||||
self.lingering_space = space_enabled
|
self.lingering_space = space_enabled
|
||||||
return index
|
return index
|
||||||
elif state == 'get attr':
|
elif state == 'get attr':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user