Skip to content

feat: add BorderStyle and IconPrefix decoration to heading styles#67

Merged
forest6511 merged 1 commit into
mainfrom
feature/heading-decoration-styles
Mar 15, 2026
Merged

feat: add BorderStyle and IconPrefix decoration to heading styles#67
forest6511 merged 1 commit into
mainfrom
feature/heading-decoration-styles

Conversation

@forest6511
Copy link
Copy Markdown
Owner

Summary

  • Add BorderStyle property to heading styles (single, double, thick, dotted, dashed, dotDash, wave, triple)
  • Add IconPrefix (decorative character prepended to heading text) and IconPrefixColor (optional custom color for the icon, falls back to heading color)
  • Both single-paragraph and border-extent-text (spacer) paths updated
  • 10 new unit tests added (297 total)

YAML Usage

H1:
  showBorder: true
  borderStyle: "double"
  borderPosition: "bottom"

H2:
  iconPrefix: ""
  iconPrefixColor: "E91E8C"

Test plan

  • Build passes with no errors
  • 297 tests passing (10 new tests for BorderStyle and IconPrefix)
  • BorderStyle applies to both AddHeadingSingleParagraph and AddHeadingWithSpacers
  • IconPrefix prepends a separate run with correct color fallback logic
  • StyleApplicator correctly maps all three new properties from config to model

Closes #66

- Add BorderStyle property to HeadingStyle/HeadingStyleConfig supporting:
  single, double, thick, dotted, dashed, dotDash, wave, triple
- Add IconPrefix and IconPrefixColor properties for decorative heading prefix
- ParseBorderStyle() helper converts YAML string to OpenXml BorderValues enum
- IconPrefix rendered as a separate run before heading text, using IconPrefixColor
  or falling back to the heading Color when IconPrefixColor is null
- Both single-paragraph and spacer-mode heading paths updated
- 10 new unit tests added (297 total, all passing)
@forest6511 forest6511 merged commit e6e81ce into main Mar 15, 2026
@forest6511 forest6511 deleted the feature/heading-decoration-styles branch March 15, 2026 23:40
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 15, 2026

Codecov Report

❌ Patch coverage is 72.50000% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.54%. Comparing base (eb706b1) to head (48ef1ff).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...kdownToDocx.Core/OpenXml/OpenXmlDocumentBuilder.cs 63.33% 9 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #67      +/-   ##
==========================================
- Coverage   89.06%   88.54%   -0.53%     
==========================================
  Files          27       27              
  Lines        1372     1405      +33     
  Branches      174      179       +5     
==========================================
+ Hits         1222     1244      +22     
- Misses        113      122       +9     
- Partials       37       39       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

Feature: Per-book heading decoration styles (number badges, accent bars, icon prefixes, border patterns)

1 participant