gerhardsletten / react-reader

An ePub-reader for React, powered by Epub.js
https://react-reader.metabits.no
Apache License 2.0
676 stars 130 forks source link

navigation check to handle OEBPS subdirectories and fragments #182

Open timsilber opened 1 week ago

timsilber commented 1 week ago

decided to create a new issue from a comment here: https://github.com/gerhardsletten/react-reader/issues/33#issuecomment-2334964115

I am getting No Section Found errors when loading certain ebooks. I have chased it down to certain EPUBs having varied directory structures of their OEBPS. if the XHTML files are directly in the OEBPS folder, the reader will load appropriately, but it they are in subdirectories (e.g. text/Introduction.xhtml) it will fail. do you have any recommendations on a fix? additionally, some books will append a an anchor link (e.g. OEBPS/xhtml/Chapter294.xhtml#sec20)

gerhardsletten commented 1 week ago

As mention in the other issue, this is a bug for epub.js.

But the epub-standard is pretty loose, and those files probably validate in in an epub-validator, but as a author of a library, how many stupid variations are you suppose to support. Cases like this happens because publishers use cheap and not qualified producers that create bad epub-files, so I would try to check if this could be checked upstream in the delivery chain..