Skip to content

fix(docs): escape pipes in table code cells so GFM tables render#495

Merged
Brooooooklyn merged 1 commit into
mainfrom
fix/docs-table-pipe-escaping
Jul 10, 2026
Merged

fix(docs): escape pipes in table code cells so GFM tables render#495
Brooooooklyn merged 1 commit into
mainfrom
fix/docs-table-pipe-escaping

Conversation

@Brooooooklyn

Copy link
Copy Markdown
Member

Problem

The Option, null, and undefined table (and two napi-attributes tables) rendered as a raw pipe-delimited paragraph:

content/ source:   header=3 cols │ delim=3 cols  OK  but cells have UNESCAPED | in code spans (`T | null | undefined`)
pages/ (vp fmt'd): header=3 cols │ delim=5 cols  BAD ← oxfmt counted the in-code pipes as columns and widened the delimiter

GFM requires the header and delimiter column counts to match; when they don't, markdown-it rejects the whole block and renders it as text.

Fix

Escape the in-code pipes as \| — the convention already used by the working yarn \| pnpm / npm \| lerna tables. @void/md strips the backslash at table-parse time, so the code renders T | null | undefined (no visible backslash). Applied to content/ source and the pages/ mirrors (mangled blocks replaced with the corrected content tables — these tables are pure markdown, no JSX).

Scope: type-conversions (1 table) + napi-attributes (2 tables) × en/cn/pt-BR = 12 files.

Verification

Check Result
Full-tree table scan (header vs delimiter cols) 0 mismatches
@void/md compile -> real <table> 8 (type-conversions) / 6 (napi-attributes) per locale
Visible backslash leaked into <code> none
Survives a vp fmt round-trip yes
content.test.ts 45/45

🤖 Generated with Claude Code

Cells like `T | null | undefined` and `field: T | null` in the type-conversions
and napi-attributes tables carried UNESCAPED `|` inside inline-code spans. GFM
reads those as extra column separators, and `vp fmt` then rewrote each table's
delimiter row to the widened column count. The header (3 or 5 cols) no longer
matched the delimiter (5 or 6), so markdown-it rejected the block and rendered
the whole table as a raw pipe-delimited paragraph (see screenshot on the
`Option, null, and undefined` section).

Escape the in-code pipes as `\|` — the same convention already used by the
working `yarn \| pnpm` / `npm \| lerna` tables. `@void/md` strips the backslash
at table-parse time, so the code renders `T | null | undefined` with no visible
backslash. Fixed in content/ source (escaped in place) and the pages/ mirrors
(mangled blocks replaced with the corrected content tables; the tables are pure
markdown, no JSX).

Scope: type-conversions (1 table) + napi-attributes (2 tables) × en/cn/pt-BR.
Verified: a full-tree table scan reports 0 header/delimiter mismatches;
`@void/md` compile yields real <table> elements (8 for type-conversions, 6 for
napi-attributes) per locale with no leaked backslash; the fix survives a `vp fmt`
round-trip; content.test.ts 45/45.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Brooooooklyn
Brooooooklyn merged commit 591e6f0 into main Jul 10, 2026
2 checks passed
@Brooooooklyn
Brooooooklyn deleted the fix/docs-table-pipe-escaping branch July 10, 2026 12:19
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.

1 participant