feat: integrate patched docx-rs fork to fix DOCX parse failures#91
Merged
developer0hye merged 1 commit intomainfrom Mar 1, 2026
Merged
feat: integrate patched docx-rs fork to fix DOCX parse failures#91developer0hye merged 1 commit intomainfrom
developer0hye merged 1 commit intomainfrom
Conversation
Add integration tests for 15 previously-failing DOCX files that now parse and convert successfully with the patched docx-rs fork. Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
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.
Summary
[patch.crates-io]Changes in docx-rs fork (developer0hye/docx-rs, branch fix/parse-tolerance)
Fix 1: Width parsing panic (US-350)
The width parser called
unwrap()onf64::from_str(), which panicked on Strict OOXML documents using 'dxa' unit values (e.g.1440dxa). Fixed by parsing the numeric prefix and ignoring trailing unit suffixes.Fix 2: Missing document rels tolerance (US-351)
read_document_rels()returnedZipError(FileNotFound)whenword/_rels/document.xml.relswas missing. Many minimal DOCX files (especially from LibreOffice's test suite) omit this optional file. Fixed by returning empty rels instead of failing.Fix 3: Missing optional parts tolerance (US-351)
Styles, numberings, settings, and web settings reads now skip gracefully when referenced files are missing or unparseable, rather than failing the entire document. This fixes tdf129659.docx where numbering.xml was referenced in rels but absent from the zip.
Fix 4: Font size unit suffix tolerance (US-351)
Font size values like "20pt" (with unit suffix) caused
ParseFloatError. Fixed by stripping known suffixes before parsing.Results
Remaining expected errors (4 files)
tdf171025_pageAfter.docx,tdf171038_pageAfter.docx— ODF files with.docxextension (not real DOCX)math-malformed_xml.docx— intentionally malformed XML (expected error)deep-table-cell.docx— on denylist (stack overflow risk from deeply nested tables)Test plan
cargo test --workspacepassescargo fmt --all -- --checkpassescargo clippy --workspace -- -D warningspassesRelated: #84
🤖 Generated with Claude Code