import ReactMarkdown from 'react-markdown' import remarkGfm from 'remark-gfm' import { makeHeadingSlugger, isInDocumentHref } from '@/lib/markdown-anchors' // Docs-brand markdown renderer. Unlike components/markdown.tsx (which is bound // to the management app's theme tokens), this emits headings with stable anchor // ids and otherwise leans on the `.docs-prose` stylesheet in docs.css so the // output matches the public site's dark / monospace / lime aesthetic. // // Content here is author-trusted (checked-in .md), but we still never enable // rehypeRaw, so any stray HTML stays inert. export function DocsMarkdown({ content }: { content: string }) { const slug = makeHeadingSlugger() return (

{children}

, h2: ({ children }) =>

{children}

, h3: ({ children }) =>

{children}

, h4: ({ children }) =>

{children}

, a: ({ href, children }) => isInDocumentHref(href) ? ( {children} ) : ( {children} ), }} > {content}
) }