Render markdown links in KeyDrawer descriptions#8
Merged
Conversation
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
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>
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.
Catalog descriptions (env-vars especially) embed
[text](url)syntaxstraight from upstream docs, so the drawer was showing raw markdown
where users expected clickable links. Adds a tiny inline-markdown
parser, an
openExternalUrlwrapper around the opener plugin, andswaps the description
<p>for token-aware rendering. Site-relativeURLs (
/en/...) resolve against the docs root the env-vars syncscript already pulls from.