Skip to content

fix(export): keep each DESIGN.md table row on one line - #237

Merged
dgesteves merged 1 commit into
mainfrom
fix/design-md-cells
Oct 23, 2026
Merged

dgesteves merged 1 commit into
mainfrom
fix/design-md-cells

Conversation

@dgesteves

Copy link
Copy Markdown
Owner

onsystem export --format design-md writes one Markdown table per token category. A cell that held a line break broke its row: a CSS comment over several lines (the token's description), or a value the stylesheet wraps, such as shadcn-style two-part shadows:

--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1),
  0 4px 6px -4px rgb(0 0 0 / 0.1);

On GitHub the rest of that row then rendered as a code block and every later row in the table as a paragraph. A CodeQL triage of alert #8 (on this line) found it; the alert itself, about \| without escaping backslashes, is a false positive: keys and values are code spans, which show \ as written.

What changed: each cell's lines are trimmed and joined with a space before the | escape. It splits and trims rather than using /\s*\n\s*/, which is quadratic on a long run of spaces.

Tests: test/export.test.ts exports a stylesheet with a two-line comment and a two-line --shadow-lg, and checks every table row starts and ends with | and holds the joined value and description. It fails on main and passes here. format:check, lint, typecheck and the full test suite (1,187 passed) pass. Patch changeset.

A token whose comment or value the stylesheet wraps over lines, such as a
two-part --shadow-lg, broke its row in DESIGN.md's tables: GitHub showed
the rest of the row as a code block and every later row as a paragraph.
Each cell's lines are now trimmed and joined with spaces (split and trim,
so a long run of spaces stays linear).
Comment thread src/tokens/export.ts Dismissed
@dgesteves
dgesteves merged commit 346c40e into main Oct 23, 2026
19 checks passed
@dgesteves
dgesteves deleted the fix/design-md-cells branch October 23, 2026 22:02
@dgesteves-release dgesteves-release Bot mentioned this pull request Oct 23, 2026
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.

2 participants