mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
FB2 Input: Workaround for unquoted ampersands
This commit is contained in:
parent
1327e15337
commit
b27c880be6
@ -43,7 +43,11 @@ class FB2Input(InputFormatPlugin):
|
|||||||
from calibre.ebooks.oeb.base import XLINK_NS
|
from calibre.ebooks.oeb.base import XLINK_NS
|
||||||
NAMESPACES = {'f':FB2NS, 'l':XLINK_NS}
|
NAMESPACES = {'f':FB2NS, 'l':XLINK_NS}
|
||||||
log.debug('Parsing XML...')
|
log.debug('Parsing XML...')
|
||||||
doc = etree.fromstring(stream.read())
|
raw = stream.read()
|
||||||
|
try:
|
||||||
|
doc = etree.fromstring(raw)
|
||||||
|
except etree.XMLSyntaxError:
|
||||||
|
doc = etree.fromstring(raw.replace('& ', '&'))
|
||||||
self.extract_embedded_content(doc)
|
self.extract_embedded_content(doc)
|
||||||
log.debug('Converting XML to HTML...')
|
log.debug('Converting XML to HTML...')
|
||||||
ss = open(P('templates/fb2.xsl'), 'rb').read()
|
ss = open(P('templates/fb2.xsl'), 'rb').read()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user