Skip to content

Expand MultiLangCodeBlock snippets in agent-facing markdown exports. - #1533

Open
scottjstrand1 wants to merge 1 commit into
mainfrom
expand-multilang-codeblocks-in-markdown
Open

Expand MultiLangCodeBlock snippets in agent-facing markdown exports.#1533
scottjstrand1 wants to merge 1 commit into
mainfrom
expand-multilang-codeblocks-in-markdown

Conversation

@scottjstrand1

Copy link
Copy Markdown
Contributor

Static .md files and llms-full.txt now render code examples from the shared snippet registry instead of leaving raw MDX component tags for agents to parse.

Static .md files and llms-full.txt now render code examples from the shared snippet registry instead of leaving raw MDX component tags for agents to parse.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jul 10, 2026 6:18pm

Request Review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk HIGH: Refactors the snippet registry out of MultiLangCodeBlock.tsx into a shared module and adds a new lib/ utility to expand <MultiLangCodeBlock> tags into plain markdown for LLM-facing exports.

Reasons

  • components/ui/MultiLangCodeBlock.tsx is modified — a .tsx file in components/ triggers HIGH risk
  • lib/expandMultiLangCodeBlocks.ts is a new .ts file in lib/, which also triggers HIGH risk
  • MultiLangCodeBlock.tsx is a shared, reusable component used across the documentation site for all multi-language code examples
  • The snippet registry extraction changes import paths and module boundaries, which could break existing snippet rendering if any entries are mismatched
  • 234 additions and 140 deletions across 4 files represents a substantial structural refactor

Notes

  • Verify that the snippet map in data/code/snippetRegistry.ts is a 1:1 match with the original map that was removed from MultiLangCodeBlock.tsx — any missing or miskeyed entry would silently break code examples on the live site
  • Confirm the regex in expandMultiLangCodeBlocks.ts (`/<MultiLangCodeBlock\b([^>]*)/>/) handles all actual usage patterns of the component in MDX files (e.g., multiline attributes, children-based usage)
  • The SNIPPET_FENCE_LANGUAGES and SNIPPET_LANGUAGE_LABELS maps are new exports that were not previously needed — review these for correctness (e.g., cURL capitalization, jsweb mapped to javascript)
  • scripts/generateLlmsTxt.ts now calls prepareMarkdownForExport in multiple places — verify the expansion runs on the right content at the right stage of the pipeline
  • Author scottjstrand1 is not in the known contributors list — changes from external contributors to shared components warrant careful review
Open in Web View Automation 

Sent by Cursor Automation: Docs PR classifier

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