feat: parse paragraph-level shading (w:pPr/w:shd) - #2
Merged
Conversation
Word paints paragraph-wide shading from pPr shading; the reader only handled run and table-cell shading, so code-block backgrounds were dropped (office2pdf#351). Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
This was referenced Jul 21, 2026
pull Bot
pushed a commit
to RadaKichenin/office2pdf
that referenced
this pull request
Jul 21, 2026
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.
What changed
ParagraphPropertygains ashading: Option<Shading>field, parsed from<w:pPr><w:shd .../>(mirroring the existing run-property and table-cell shading arms) and emitted on build.Why
Word paints paragraph-wide shading (code blocks, callouts) from pPr shading; dropping it loses those backgrounds in developer0hye/office2pdf#351.
Testing
test_read_paragraph_shadingcargo test -p docx-rs --lib— 273 tests greentests/lib.rsinsta snapshot suite already fails 20/40 on the base branch (pre-existing, unrelated to this change); snapshots are left untouched.🤖 Generated with Claude Code