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

Nav Parsing is too strict #116

Closed
majora2007 opened this issue Nov 26, 2024 · 4 comments · Fixed by #119
Closed

Nav Parsing is too strict #116

majora2007 opened this issue Nov 26, 2024 · 4 comments · Fixed by #119
Assignees
Milestone

Comments

@majora2007
Copy link

Description

Upon updating to v3.2.2 Epubs are now throwing this exception for MANY of my users epubs. Is there potential to have a PackageReaderOptions setting to not throw on invalid nav and just fail silently?

The reality of the situation is many people have bad epubs, publishers rarely pack them correctly. I'm in a constant battle to support broken epubs. This library is the absolute best out there, but I need some more flexibility to allow some invalid epubs.

Is this feasible for you?

VersOne.Epub.Epub3NavException: EPUB parsing error: 'nav' element in the navigation file does not contain a required 'ol' element.

Nav page:

<nav>
<div class="s30">
<a href="../Text/part0000.xhtml">Cover</a>
</div>

Sample EPUB file

I can email you an epub. Git commits signed with an email that will reach me.

EPUB specification link

Additional context

Hope you are well, still looking forward to your Audio/Media implementation :)

@majora2007
Copy link
Author

I just rolled back to v3.3.1 and experienced the same, I think it's due to my other issue I rolled out.

#91

I suppose the fix here, which is valid, also means that parsing is much stricter. I think a setting to allow how to report (throw exception or silently fail) would be the best (and i can pass that responsibility to my users).

@vers-one
Copy link
Owner

Is it just this NAV parsing error or are the more? Could you post the list of errors you would like to be able to ignore?

@majora2007
Copy link
Author

The only other one I can think of that might be nice to ignore is when the opf points to a file that's not in the archive. This seems to be very common as well and seems fit for a silent fail. I can look up the exception after work.

@vers-one
Copy link
Owner

vers-one commented Dec 16, 2024

Implemented. Will be released in version 3.3.3 in about a week.

@vers-one vers-one self-assigned this Dec 16, 2024
@vers-one vers-one added this to the 3.3.3 milestone Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants