Repository navigation
fix(export): keep each DESIGN.md table row on one line - #237
Merged
Merged
Conversation
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).
Merged
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.
onsystem export --format design-mdwrites 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: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.tsexports 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.