Skip to content

Render markdown links in KeyDrawer descriptions#8

Merged
samkeen merged 3 commits into
mainfrom
claude/fix-markdown-links-Mnknv
May 8, 2026
Merged

Render markdown links in KeyDrawer descriptions#8
samkeen merged 3 commits into
mainfrom
claude/fix-markdown-links-Mnknv

Conversation

@samkeen
Copy link
Copy Markdown
Contributor

@samkeen samkeen commented May 8, 2026

Catalog descriptions (env-vars especially) embed [text](url) syntax
straight from upstream docs, so the drawer was showing raw markdown
where users expected clickable links. Adds a tiny inline-markdown
parser, an openExternalUrl wrapper around the opener plugin, and
swaps the description <p> for token-aware rendering. Site-relative
URLs (/en/...) resolve against the docs root the env-vars sync
script already pulls from.

claude added 3 commits May 8, 2026 22:38
Catalog descriptions (env-vars especially) embed `[text](url)` syntax
straight from upstream docs, so the drawer was showing raw markdown
where users expected clickable links. Adds a tiny inline-markdown
parser, an `openExternalUrl` wrapper around the opener plugin, and
swaps the description `<p>` for token-aware rendering. Site-relative
URLs (`/en/...`) resolve against the docs root the env-vars sync
script already pulls from.
Swaps the hand-rolled link parser for react-markdown so descriptions
also pick up inline code, emphasis, and strong without growing custom
regex. The component map overrides only the nodes that show up in
catalog descriptions: <a> still routes through openExternalUrl (with
relative `/en/...` URLs resolved against the docs root), <code> picks
up the inspector's mono styling, and <p> drops its margin so the node
slots into the drawer's existing prose block.
Adds a design principle to catalog-sync.md making it explicit that
description/purpose fields are CommonMark and must be preserved
verbatim by sync scripts (no backtick stripping, no HTML decoding,
no link mangling). Cross-links from the inspector-ui drawer section
so the producer/consumer contract is visible from both ends.

Existing sync scripts already pass these fields through verbatim —
this codifies the contract for future ones.
@samkeen samkeen merged commit fc1614c into main May 8, 2026
3 checks passed
@samkeen samkeen deleted the claude/fix-markdown-links-Mnknv branch May 8, 2026 23:20
samkeen added a commit that referenced this pull request May 9, 2026
PR #8 added react-markdown so [text](url) links in catalog prose
became clickable, but settings descriptions tend to use bare URLs
(e.g. "See https://code.claude.com/...") which CommonMark leaves as
plain text. Wires remark-gfm into the InlineMarkdown renderer so
autolink literals also pass through the existing <a> handler that
opens links via the opener plugin. Catalog-sync spec updated to call
the prose dialect GFM rather than CommonMark.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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