Repository navigation
fix(documents): bound DOCX table rendering - #184
Merged
Merged
Conversation
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
Both local DOCX backends admit table dimensions and padded-cell work before rendering: at most 1,000 rows, 50 columns and 50,000 padded cells. The deprecated Office converter also admits exact escaped UTF-8 output bytes into one 10 MiB buffer before padding or allocation, preserving normal headers, sparse-row padding, empty-row removal and escaping.
The default markkit backend preflights the conventional main part and internal relationship-selected main parts, including merged-cell spans and nested tables. It honors tighter configured archive budgets. No new dependency versions or public API fields.
The shared legacy table writer also caps each spreadsheet table at 10 MiB. The hardening guide and canonical contracts document this ceiling and markkit preflight's 50-level table nesting cap.
Why
Archive/input caps did not constrain the row-count × widest-row expansion. Final response truncation happened after allocation. Moving to markkit changed the default backend but retained this table-padding concern in both selectable implementations.
Before / After
Ordinary offline fixture: two rows, three columns, four populated cells; injected limits of one row, two columns, five padded cells, or 32 output bytes.
Before enforcement:
After:
Existing normal DOCX heading/list/table assertions and offline tool/fetch conversion pass. Added a normal DOCX whose main XML lives at a relationship-selected nonstandard path. No large archive/table or memory-exhaustion experiment was run.
Risk
Checklist
docs-office.Validation: formatter; workspace Clippy with
-D warnings; Office-only Clippy; warning-free workspace rustdoc; publishable workspace release build. CI workflows are unchanged.