mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
EPUB Input: When an invalid nav based ToC is used in an EPUB 3.0 document that also has a fallback NCX ToC, use the fallback ToC. Fixes #1643247 [Private bug](https://bugs.launchpad.net/calibre/+bug/1643247)
This commit is contained in:
parent
05bec937b5
commit
1145607df4
@ -350,6 +350,8 @@ class EPUBInput(InputFormatPlugin):
|
||||
if ol is not None:
|
||||
process_nav_node(ol, navmap)
|
||||
break
|
||||
else:
|
||||
return
|
||||
|
||||
with NamedTemporaryFile(suffix='.ncx', dir=os.path.dirname(nav_path), delete=False) as f:
|
||||
f.write(etree.tostring(ncx, encoding='utf-8'))
|
||||
@ -368,5 +370,3 @@ class EPUBInput(InputFormatPlugin):
|
||||
spine = {x.href for x in oeb.spine}
|
||||
if (cover_toc_item is not None and cover_toc_item not in spine):
|
||||
oeb.toc.item_that_refers_to_cover = cover_toc_item
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user