fix: accept border style="none" in loadWorkbook (#99) - #102
Merged
Conversation
OnlyOffice (and other producers) write border sides as <left style="none"/>. `none` is the first value of ECMA-376 §18.18.3 ST_BorderStyle (no stroke), but it was missing from SideStyle, so loadWorkbook threw `expected one of [thin, medium, ...]; got "none"`. Excel omits the side element in this case, which is why it went unnoticed. `none` is now accepted, round-trips faithfully, and draws no stroke in HTML/SVG preview. Closes #99 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HYPZEKSkTxi46S3x2sAyGg
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.
Summary
loadWorkbookrejected any workbook whose border sides usestyle="none", throwingexpected one of [thin, medium, ...]; got "none".noneis the first value of ECMA-376 §18.18.3ST_BorderStyle(no stroke), so it is valid input and is now accepted.Motivation
OnlyOffice — and other producers — write the no-border value explicitly as
<left style="none"/>. Excel omits the side element in that case, which is why this went unnoticed until a file from OnlyOffice hit it. The value was simply missing from theSideStyleenumeration.Closes #99
Changes
@office-kit/xlsx/styles:SideStyle(andSIDE_STYLES) now include'none'. Sides withstyle="none"parse, round-trip faithfully, and draw no stroke in HTML/SVG preview.Testing
tests/styles/issue-99.test.ts— a failing-first test that parses<side style="none"/>and exercisesmakeSide({ style: 'none' }).lookup_values_lut.xlsx(5 sides withstyle="none"): it threw before this change and loads cleanly after, withnonepreserved on round-trip.pnpm typecheck && pnpm lint && pnpm testgreen.Reproduce:
Breaking changes
None. This widens accepted input; existing values are unaffected.
Checklist