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:
Kovid Goyal 2016-11-20 22:59:48 +05:30
parent 05bec937b5
commit 1145607df4

View File

@ -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