fix(docs): escape pipes in table code cells so GFM tables render#495
Merged
Conversation
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>
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.
Problem
The
Option, null, and undefinedtable (and twonapi-attributestables) rendered as a raw pipe-delimited paragraph: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 workingyarn \| pnpm/npm \| lernatables.@void/mdstrips the backslash at table-parse time, so the code rendersT | null | undefined(no visible backslash). Applied tocontent/source and thepages/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
@void/mdcompile -> real<table><code>vp fmtround-tripcontent.test.ts🤖 Generated with Claude Code