MCPcopy Create free account
hub / github.com/danielpetho/fancy / convertCodeSnippetsToMarkdown

Function convertCodeSnippetsToMarkdown

src/scripts/build-docs-markdown.ts:269–278  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

267}
268
269function convertCodeSnippetsToMarkdown(content: string): string {
270 // Convert CodeSnippet components to regular markdown code blocks
271 return content.replace(
272 /<CodeSnippet\s+title="([^"]*)"[^>]*>\s*```(\w+)?\n([\s\S]*?)\n```\s*<\/CodeSnippet>/g,
273 (match, title, language, code) => {
274 const lang = language || "typescript"
275 return `${title ? `### ${title}\n\n` : ""}\`\`\`${lang}\n${code}\n\`\`\`\n\n`
276 }
277 )
278}
279
280function convertTablesToMarkdown(content: string): string {
281 // Convert JSX tables to proper markdown tables

Callers 1

convertMdxToMarkdownFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected