ToC Editor: Fix ToC detection in EPUB 3 files with only an NCX and no nav not working

This commit is contained in:
Kovid Goyal 2016-06-23 06:21:41 +05:30
parent 768ca3106c
commit 56a8b58046

View File

@ -256,7 +256,10 @@ def get_toc(container, verify_destinations=True):
if ver.major < 3:
return get_x_toc(container, find_existing_ncx_toc, parse_ncx, verify_destinations=verify_destinations)
else:
return get_x_toc(container, find_existing_nav_toc, parse_nav, verify_destinations=verify_destinations)
ans = get_x_toc(container, find_existing_nav_toc, parse_nav, verify_destinations=verify_destinations)
if len(ans) == 0:
ans = get_x_toc(container, find_existing_ncx_toc, parse_ncx, verify_destinations=verify_destinations)
return ans
def ensure_id(elem):
if elem.tag == XHTML('a'):