Skip to content

fix: accept explicit no-underline stylesheet fonts - #207

Merged
baseballyama merged 1 commit into
mainfrom
fix/206-underline-none
Oct 1, 2026
Merged

baseballyama merged 1 commit into
mainfrom
fix/206-underline-none

Conversation

@baseballyama

Copy link
Copy Markdown
Member

Summary

Allow stylesheet fonts containing <u val="none"/> to load and round-trip instead of throwing OpenXmlSchemaError. Keep the explicit value in cell and differential fonts, and render it as no underline in fontToCss.

Motivation

Closes #206.

FontSchema uses UNDERLINE_STYLES to validate XML, but that list omitted none, a valid ST_UnderlineValues member in the vendored SpreadsheetML XSD and Microsoft's reference. Both workbook loaders therefore rejected the report described in the issue. A synthetic XLSX reproduces the same exception without needing the reporter's private data.

Changes

  • Accept and preserve none in the existing UnderlineStyle model and font schema. Keeping it distinct from an absent field also preserves explicit overrides in differential styles.
  • Emit text-decoration: none for explicit no-underline fonts, while retaining strike-through when set.
  • Document the value on the existing font APIs and add a patch changeset.

Testing

  • pnpm vitest run tests/styles/issue-206.test.ts: 13 cases cover all valid underline values, bare/absent elements, invalid values, CSS, regular and streaming loading, editing, and save/reload. Four cases failed with the reported exception before the fix.
  • The synthetic input and saved XLSX both pass OPC, XSD and semantic conformance validation.
  • Full suite: 3,196 tests passed; lint, typecheck, knip, build, size, check:attw, and check:consumer passed.
  • PERF_GATE=1 pnpm test:perf passed.

Breaking changes

None. Previously accepted values and the bare <u/> default retain their behavior.

Checklist

  • I have read CLAUDE.md and followed the project's conventions.
  • I have added or updated tests for the change.
  • I have added or updated documentation where user-visible behavior changed.
  • If this is a user-visible change, I have run pnpm changeset and committed
    the result.
  • If this is a breaking change, I have flagged it above and the changeset is
    marked accordingly.
  • I have re-read my own diff and removed dead code, debug prints, and stale
    comments.
  • If I used an LLM to draft this PR, I have verified each change myself, this
    PR represents real work that warrants a maintainer's review, and I am
    willing to defend each line in review.

Copilot AI balanced review requested due to automatic review settings October 1, 2026 16:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@baseballyama
baseballyama merged commit 55be009 into main Oct 1, 2026
14 checks passed
@baseballyama
baseballyama deleted the fix/206-underline-none branch October 1, 2026 16:43
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.

bug: stylesheet font underline val="none" throws OpenXmlSchemaError: expected one of [single, double, singleAccounting, doubleAccounting], got "none"

2 participants