feat: render shaded blockquotes as single-cell tables for true 4-sided padding#73
Merged
Conversation
…d padding Closes #72 Replaces the invisible-paragraph-border padding hack with w:tcMar on a borderless single-cell w:tbl when BackgroundColor + any padding is set. This eliminates the 31pt cap, removes the page-margin clipping risk on narrow LeftIndent values, and finally adds left-side padding (the bug reported in #72). Quote blocks without a background color, or without padding, keep the existing paragraph rendering path verbatim. API additions on QuoteStyle / QuoteStyleConfig: PaddingTop, PaddingRight, PaddingBottom, PaddingLeft (uint, twips) EffectivePadding{Top,Right,Bottom,Left} (per-side > 0 wins, else PaddingSpace*20) HasAnyPadding Backward compatibility: PaddingSpace (uint, points) retained as a documented deprecated alias filling all four sides via the EffectivePadding* getters. All 13 loadable presets convert successfully; business.yaml (the only preset using PaddingSpace) now correctly gets left padding too. See docs/decisions/ADR-0004-quote-block-padding.md for the full rationale, alternatives considered (LeftBorder hack, per-side LeftPaddingSpace, do nothing), and migration plan. Tests: 315 passing (4 new for cell-mode, 2 rewritten from old paragraph assertions; 2 new in StyleApplicator covering precedence).
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #73 +/- ##
==========================================
+ Coverage 88.88% 89.16% +0.27%
==========================================
Files 28 28
Lines 1449 1606 +157
Branches 183 205 +22
==========================================
+ Hits 1288 1432 +144
- Misses 122 128 +6
- Partials 39 46 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Address Codecov patch coverage gap on PR #73: - list rendering inside a padded shaded blockquote - BorderPosition with multiple non-default sides ("top,bottom,right") - inline code run inside cell-mode quote paragraph (ApplyInlineCodeFont) Brings coverage of new lines in OpenXmlDocumentBuilder.cs to 100%.
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.
Closes #72
Summary
BackgroundColor+ any padding as a single-cell, borderlessw:tblwithw:tcMarfor true 4-sided padding (twip precision, no 31pt cap, no page-margin clipping).QuoteStyle/QuoteStyleConfig(PaddingTop/Right/Bottom/Left, twips).PaddingSpace(uint, points) as a documented deprecated alias mapping to all four sides viaEffectivePadding*getters — backward-compatible for all 13 loadable presets, includingbusiness.yaml(the only one usingPaddingSpace), which now correctly gets left padding too.See
docs/decisions/ADR-0004-quote-block-padding.mdfor the full rationale, alternatives considered, and migration plan.Test plan
dotnet test— 315/315 passing (4 new cell-mode tests, 2 rewritten from paragraph assertions, 2 newStyleApplicatorprecedence tests, 1 vertical-text+cell, 1 empty-content-cell)business.yamloutput verified to emit<w:tbl>with<w:tcMar>of 80 twips on all four sides (incl. left — the Issue Quote: PaddingSpace cannot express left-side padding #72 fix)default.yaml(no BG) verified to stay in paragraph mode (0 tables, 7<w:pBdr>)