mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 04:39:31 +08:00
Finder's "Compress" does two things to an EPUB: it nests the whole book under one folder, and it writes a parallel `__MACOSX/` tree of AppleDouble resource forks that carry the content files' names and extensions. The package lookup only ever looked for `META-INF/container.xml` at the archive root, so a wrapped book found no container, no OPF and no spine, and fell back to matching file extensions over the whole archive. That fallback then read `__MACOSX/OEBPS/._index_split_000.xhtml` — 60 bytes of binary resource fork — as a chapter. Hence the phantom `._…` sections in the sidebar and "Could not load this section" on opening them (#1447). Both halves of the same rule, in one place. Packaging residue (`__MACOSX`, dotfiles) is not book content and never reaches either reader; the other archive readers in this codebase already drop it. And a single wrapper directory is resolved from wherever the container actually sits, so spine order survives it. The container/OPF chain was written out twice — once for the spine, once for the navigation — so a wrapped book silently lost its whole outline too, by a `return []` in the half nobody was looking at. One resolver now answers "where is this book's package document" for both. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>