Repository navigation
feat(formats): add ODT input - #54
Merged
Merged
Conversation
Plain text (always on) goes through the IR: paragraphs on blank lines, hard breaks on single newlines. Markdown (new `markdown` feature, in all_formats) is re-parsed with pulldown-cmark into the IR and rendered back, so raw HTML never passes through. Both decode UTF-8/UTF-16 BOMs, drop control characters and warn on lossy decoding. Neither is sniffed from bytes. Threat model T7, invariant S13.
…-3z7tjs # Conflicts: # CHANGELOG.md # README.md # crates/markkit/Cargo.toml # crates/markkit/src/extract.rs # crates/markkit/src/lib.rs # knowledge/log.md # knowledge/security/threat-model.md
…-3z7tjs # Conflicts: # knowledge/log.md
…-3z7tjs # Conflicts: # knowledge/log.md
…-3z7tjs # Conflicts: # .github/workflows/ci.yml # crates/markkit/Cargo.toml # crates/markkit/src/extract.rs # crates/markkit/src/lib.rs # knowledge/log.md # knowledge/security/threat-model.md
…-3z7tjs # Conflicts: # knowledge/log.md # knowledge/security/threat-model.md
Always-on RFC 4180 reader renders delimited text as one GFM table. Delimiter is tab for TSV and detected among , ; tab | for CSV. Reading is bounded by max_sheet_rows / max_sheet_cols (truncated_table warning); unterminated quotes emit malformed_csv. Adds Format::Tsv.
…-3z7tjs # Conflicts: # CHANGELOG.md # README.md # crates/markkit/src/extract.rs # knowledge/formats/format-support.md # knowledge/log.md # knowledge/security/threat-model.md
nbformat 4 notebooks render Markdown cells through the Markdown path, code cells as fenced blocks tagged with the kernel language, and text outputs and tracebacks (ANSI stripped) as text blocks; rich outputs are skipped. Adds Format::Notebook, Error::NotebookExtract and ExtractionStats::cells.
With no format feature, extract_document rendered unbounded, so always-on text, CSV and notebook input ignored max_output_size and the timeout (csv_integration::security_timeout_applies failed under --no-default-features). Bounded rendering is now unconditional, decoding is followed by a deadline check, and CI tests --no-default-features.
# Conflicts: # crates/markkit/src/extract.rs # crates/markkit/src/format.rs # crates/markkit/src/lib.rs # crates/markkit/src/limits.rs # crates/markkit/src/render/markdown.rs # knowledge/log.md # knowledge/operations/testing.md
…to claude/project-thread-3z7tjs
New email feature (mail-parser 0.11) renders subject, From/To/Cc/Date, the plain-text body (HTML alternative through the HTML parser when no plain part exists) and an attachment list. Header values are folded so encoded newlines cannot inject lines; attachments are never parsed. Adds Format::Eml, Error::EmailExtract, ExtractionStats::attachments.
…-3z7tjs # Conflicts: # crates/markkit-js/src/lib.rs # crates/markkit/src/extract.rs # knowledge/formats/format-support.md
…to claude/project-thread-3z7tjs
New odt feature reuses the bounded ZIP and XML readers from DOCX: headings (outline level, styled, Title), bold/italic/strike from text properties with run merging, links, ordered/bulleted lists, tables with repeat counts capped by the sheet limits. Notes, annotations, tracked changes and frames are skipped. Adds Format::Odt (sniffed from the ODF mimetype) and Error::OdtExtract.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
New
odtfeature (inall_formats, so CLI and Python/Node bindings get it) converts OpenDocument text (.odt,.ott, sniffed from the ODFmimetypeentry like ODS) to Markdown:text:houtline levels and from paragraph styles with a default outline level. ATitlestyle becomes#and the title, unlessmeta.xmlhas adc:title.max_sheet_rows/max_sheet_cols, and the padding producers add is dropped.include_hidden_content(true). That covers text styledtext:display="none", hidden sections,text:hidden-textandtext:hidden-paragraph, and it emits ahidden_content_skippedwarning.Format::Odt("odt") andError::OdtExtract.It reuses DOCX's bounded ZIP and XML readers and shares the call's
Limitsbudget (nodes, timeout, depth, output cap). Text stays raw in the IR and the renderer escapes it.Why
This is part of the cheap-formats roadmap initiative (text/Markdown, CSV/TSV, ipynb and EML are already merged).
Before / After
The hidden "IGNORE PREVIOUS INSTRUCTIONS" span is dropped. I ran tests locally under all features, the default build,
--no-default-features,docx,spreadsheet,markdown,email,odtandodtalone; clippy passes with-D warnings. CI now tests the no-HTTP feature set withodtadded.Risk
archive/xmlwith DOCX/PPTX. The cfg lists were widened, and no reader logic changed.Checklist
odt_integration. Security cases cover a wrong package, zip bomb, entity expansion, deep nesting, repeat counts, style cycles, truncated archives, hidden content on and off, limits (max_nodes, timeout) and markup escaping.Requested by Михайло · project thread
Generated by Claude Code