fix(docx): cell padding, white shading, and style-inherited list numbering#187
Open
nikith-18161 wants to merge 5 commits into
Open
fix(docx): cell padding, white shading, and style-inherited list numbering#187nikith-18161 wants to merge 5 commits into
nikith-18161 wants to merge 5 commits into
Conversation
Signed-off-by: nikith-18161 <nikith.molaka@progentys.com>
…sheet Signed-off-by: nikith-18161 <nikith.molaka@progentys.com>
Signed-off-by: nikith-18161 <nikith.molaka@progentys.com>
Signed-off-by: nikith-18161 <nikith.molaka@progentys.com>
…ering Three DOCX parser bugs fixed: 1. extract_cell_padding: a dangling ? on extract_insets_from_margins_json caused early return when any margin side was absent, silently dropping all padding including table-level inherited defaults. 2. extract_cell_shading: FFFFFF was skipped as if it were transparent. Cells explicitly set to white to override a dark table background were silently dropped. Only 'auto' should be skipped. 3. extract_num_info: Word built-in list styles (List Bullet, List Number) store numPr on the style definition, not the paragraph. The parser only checked paragraph-level numPr. Added fallback to style-level numbering so these lists render correctly. Signed-off-by: nikith-18161 <nikith.molaka@progentys.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
Three DOCX parser bugs fixed — cell padding early-exit, white cell background silently dropped, and Word built-in list styles (List Bullet / List Number) not rendering.
Changes
docx_tables.rs— Cell padding early-exit removedextract_cell_padding()had a?on a discardedextract_insets_from_margins_json()result that caused early return whenever any margin side was absent. Cells with partial margin specs (e.g. top+bottom only) lost all padding including table-level defaults.docx_tables.rs— White cell background no longer skippedextract_cell_shading()was skipping"FFFFFF"as if it were transparent. Cells explicitly set to white (to override a dark table background) now render correctly. Only"auto"is skipped.docx_lists.rs+docx.rs— Style-inherited list numberingextract_num_info()only checked the paragraph's inline<w:numPr>. Word built-in list styles (List Bullet,List Number) store their numbering on the style definition, not the paragraph. Added fallback to look up the style'snumPrwhen the paragraph has none.Testing
cargo test -p office2pdf --test docx_fixtures— 143 passed, 0 failed