An .epub opens as its title, author and chapters
An .epub opens on the blob page as facts instead of a binary. Source and Raw stay one tap away.
- Facts: title, author(s) and language from the OPF; the chapters in reading order (
META-INF/container.xmlnames the OPF, its spine gives the order, the nav document or NCX gives the titles; a chapter with no title shows its file name); and the first chapter's text as a plain excerpt of at most 2,000 characters. - Never rendered: chapter XHTML is stripped to text (tags, scripts, styles and comments dropped) and escaped; nothing from the book runs or loads.
- Caps: read through the same zip floor as
.docx: at most 1,000 parts, 64 MB unpacked, 2 MB per XML part; at most 1,000 chapters listed. Files over 20 MB keep Source. - Hostile files: a path that climbs out of the zip is never read; a book with no readable OPF shows a note and what the zip allows; a zip bomb or a file that is not a zip shows its source. Nothing throws.
- No script, no new CSS, no dependency. The terminal workspace opens it the same way (
src/tui/screens/workspace_office.ts, throughreadBookand the page's gate): title, author, language, chapters and the excerpt as rows.
Code: src/web/render/epub.ts, src/web/render/kinds.ts. Test: test/render-epub.test.ts, test/tui-office.test.ts, test/fuzz-renderers.test.ts.