fix(docx): render paragraph shading - #382
Merged
Merged
Conversation
Word paints w:pPr/w:shd behind the whole paragraph (code-block backgrounds); the fill was dropped. The docx-rs patch branch now parses paragraph shading (developer0hye/docx-rs#2); carry it through the IR as a paragraph background and fill the full-width block wrapper. 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
Paragraph-level shading (
w:pPr/w:shd) was dropped: the CLI-manual fixture's shaded monospace code blocks rendered on plain white, indistinguishable from body text. docx-rs only parsed run and table-cell shading, so the docx-rs patch branch now reads paragraph shading (developer0hye/docx-rs#2, merged). office2pdf carries the fill through the IR (ParagraphStyle.background, style merge included) and paints it on the paragraph's full-width block wrapper.Related issue
Fixes #351
Testing
cargo test --workspace— all green (perf suite re-run in isolation)test_paragraph_shading_extracted_as_background(parser),test_generate_paragraph_with_background_shading(codegen), plusParagraphStyle::merge_fromcoverage; docx-rs gainstest_read_paragraph_shading05_technical_manual_en.docx: all four code blocks now carry the light-gray background, matching the Word GT at 150 DPIVisual impact
Visual audit
05_technical_manual_en.docx(synthetic real-world audit set, external)fixassets/bugfixes/issue-351/gt.jpgassets/bugfixes/issue-351/before.jpgassets/bugfixes/issue-351/after.jpgVisual comparison
Required inspection
Deviation audit
Checklist
Signed-off-byline🤖 Generated with Claude Code