feat: Phase D.20: Font.shading — run-level background color#92
feat: Phase D.20: Font.shading — run-level background color#92citconv-agents[bot] wants to merge 2 commits intomasterfrom
Conversation
Add support for run-level background/shading via w:rPr > w:shd, allowing any RGB color as text background. Distinct from Font.highlight_color which is limited to the WD_COLOR_INDEX palette. Closes #33 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Security Agent Report SECURITY_PASS Security Review: PR #92 — Font.shading_color for run-level RGB background colorScopeThree files changed:
FindingsXML Injection / XXENo issues found. The Path TraversalNo issues found. No file paths are involved in these changes. Dependency RisksNo issues found. No new dependencies are introduced. The change reuses existing internal types ( Data Exposure / Unsafe File HandlingNo issues found. No file I/O, no sensitive data handling. Secrets in CodeNo issues found. No API keys, tokens, or passwords present. The hex values in tests ( Miscellaneous
SummaryAll changes are confined to adding a well-typed property ( |
|
Review Agent REVIEW_CHANGES_NEEDED PR #92 — Font.shading_color for run-level RGB background colorIssue: Import inside property setterFile: @shading_color.setter
def shading_color(self, value: RGBColor | None) -> None:
if value is None:
self._remove_shd()
return
shd = self.get_or_add_shd()
from docx.enum.table import WD_SHADING_PATTERN # ← move to module level
shd.val = WD_SHADING_PATTERN.CLEAR
shd.fill = valueAll other enum imports in this file are at module level (lines 9-10: from docx.enum.table import WD_SHADING_PATTERNEverything else looks correct
|
Address review feedback on PR #92 — inline import in shading_color setter moved to top of file, consistent with all other enum imports. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Security Agent Report SECURITY_PASS Security Review — PR #92Reviewed: 2026-04-05 SummaryNo security issues found. The PR is clean. Files Reviewed
ChecksXML / XXE InjectionNo risk. The
There is no pathway for arbitrary string content to reach the XML attribute. Path TraversalNot applicable. No file I/O introduced. New DependenciesNone added. Sensitive Data / SecretsNone present. Data ExposureThe feature reads and writes Logic / Access ControlThe setter correctly delegates to the existing ConclusionThe change is a straightforward, narrowly-scoped addition. All user-visible data flows through strongly-typed value objects with range validation before reaching XML serialization. No security concerns identified. |
|
Review Agent REVIEW_APPROVED PR #92: Font.shading_color for run-level RGB background colorThe implementation is correct, well-tested, and consistent with existing patterns. Positive notesConsistent with existing table API: The Correct Setter behavior is internally consistent: Removing the entire Good test coverage: The parametrized test matrix covers all meaningful cases — no rPr, Minor observations (non-blocking)
|
Summary
Implements #33
This PR was automatically generated by the Developer Agent.
Original Issue
Add support for run-level background/shading (distinct from highlight color).
API Design
XML
w:rPr > w:shd with w:val='clear' w:fill='RRGGBB'
Note: font.highlight_color already exists for the basic highlights. This is the custom RGB background.
Upstream: python-openxml#309 (11 comments)
Generated by Developer Agent using Claude Code