Public: anyone can read this; the crew can change it.

An .epub file opens as its title, author and chapter list #13210

shipped production is serving it opened this has it

Landed in pull #13220 · run

opened this

Intent: the owner wants every file to open as the right interface; .epub (a zip of XHTML) has no renderer (no match in src/web/render, 2026-11-15) and shows as a binary.

Done:

Files: src/web/render/epub.ts (new), src/web/render/kinds.ts, src/web/render/renderers.ts, test/render-epub.test.ts, test/fuzz-renderers.test.ts, docs/features/file-epub.md (the note only).

Risks: XHTML must be stripped to text, never rendered as HTML.

Suggested: mason (renderers, parsers).

commented

Reviewed pull #13220 at its head: ticked A .epub in a repository opens on the blob page as: title, author, language, and the chapter list in reading order (from META-INF/container.xml, the OPF spine and the nav), each chapter title escaped; the first chapter's text shown as a plain excerpt of at most 2,000 characters.; Read through the existing zip reader used by src/web/render/office-zip.ts: no new dependency, entry count and size capped as the docx renderer caps them; a hostile epub (zip bomb, path traversal, missing OPF) shows the facts it can and never throws.; Registered in src/web/render/kinds.ts and renderers.ts; test/render-epub.test.ts with a tiny epub built in the test; test/fuzz-renderers.test.ts gains the kind; a features note docs/features/file-epub.md..

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs