Skip to content

feat: parse paragraph-level shading (w:pPr/w:shd) - #2

Merged
developer0hye merged 1 commit into
fix/parse-tolerancefrom
fix/paragraph-shading
Jul 21, 2026
Merged

feat: parse paragraph-level shading (w:pPr/w:shd)#2
developer0hye merged 1 commit into
fix/parse-tolerancefrom
fix/paragraph-shading

Conversation

@developer0hye

Copy link
Copy Markdown
Owner

What changed

ParagraphProperty gains a shading: 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

  • New reader unit test test_read_paragraph_shading
  • cargo test -p docx-rs --lib — 273 tests green
  • Note: the tests/lib.rs insta snapshot suite already fails 20/40 on the base branch (pre-existing, unrelated to this change); snapshots are left untouched.

🤖 Generated with Claude Code

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>
@developer0hye
developer0hye merged commit a7c041f into fix/parse-tolerance Jul 21, 2026
2 of 4 checks passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant