Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse <nav> elements nested in other HTML elements in EPUB 3 navigation documents #106

Closed
majora2007 opened this issue Oct 22, 2023 · 2 comments · Fixed by #113
Closed
Assignees
Labels
Milestone

Comments

@majora2007
Copy link

I'm debugging a book where the Navigation items aren't loading for Table of Contents generation.

This book has a TOC file within it, I see a line in the manifest:

But the GetNavigationAsync() returns nothing. Maybe I have a misunderstanding of the point of this API?

Here are the needed files:
content.opf.txt
toc.ncx.txt
toc.xhtml.txt

@vers-one
Copy link
Owner

When EpubReader parses toc.xhtml file, it expects to find the <nav epub:type="toc"> element among the children of the <body> element. In this case, the <nav> element is wrapped in <div>, so EpubReader can't find it.

Interestingly, EPUB specification does not specify whether <nav> elements can be wrapped in other elements. It also doesn't prohibit nesting one <nav> into another <nav>. I'll add support for this case in the next release.

@vers-one vers-one changed the title Table of Contents not being read with GetNavigationAsync()? Parse <nav> elements nested in other HTML elements in EPUB 3 navigation documents Oct 22, 2023
@vers-one vers-one self-assigned this Oct 22, 2023
@vers-one vers-one added bug and removed question labels Oct 22, 2023
@vers-one vers-one added this to the 3.3.2 milestone Oct 22, 2023
@vers-one
Copy link
Owner

vers-one commented Jun 4, 2024

Sorry it took so long. This is fixed in 3.3.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants