Office documents and layered images (.docx, .pptx, .ora)
Each is a zip of XML; the forge lists facts from it with no library and shows them instead of a download link.
- .docx: its headings as an outline (styles
Heading1…Heading6,Title, or an outline level) and the first 200 non-empty paragraphs as plain text. Formatting, images and tables are not drawn. - .pptx: each slide's number and title, in presentation order (the title placeholder's text;
(no title)otherwise). - .ora: layers (name, pixel size from the layer's PNG, visible or hidden), top first, from
stack.xml, and the merged preview. The preview is inlined as adata:image/pngonly whenmergedimage.pngis really a PNG of at most 4 MB. - Zip bombs: a file declaring more than 1,000 entries or 64 MB unpacked is refused before any part is read; one inflation budget of 64 MB is spent across every part read, and one part may not inflate past 16 MB (2 MB per slide). Sources:
src/web/render/office-zip.ts. - Fallback: a damaged, encrypted, zip64 or wrong-format file keeps the source view with a sentence saying why; never an error page.
- Hostile XML: parts are walked in one forward pass (
elementsandtagsinoffice-zip.ts), never with a regex that can rescan; an unclosed tag ends the walk, and each walk stops at a cap on matches. - Terminal: the workspace opens the same files with the same readers and caps (
src/tui/screens/workspace_office.ts), as a table of plain text: a .docx is its first 200 paragraphs, each once, withH1…H6beside the headings; a .pptx is slide number and title; an .ora is layer name, size and visibility (no preview). A file over the page's cap, or one that cannot be read, shows a sentence saying why. - Left out: tables, comments and notes in documents; layer blend modes and offsets; the .ora preview in the terminal.
- Code:
src/web/render/docx.ts,pptx.ts,ora.ts; kindsdocument,slides,layersinkinds.ts. Served asapplication/octet-streamalways.