code-hike / bright

React Server Component for syntax highlighting
https://bright.codehike.org
1.45k stars 20 forks source link

parseChildren: don't assume className is defined #13

Closed MaxLeiter closed 1 year ago

MaxLeiter commented 1 year ago

See #12 for more information. className is not always defined with an empty code block:

import { MDXRemote } from "next-mdx-remote/rsc";
import { Code } from "bright";

export default function Page() {
  return (
    // @ts-expect-error RSC
    <MDXRemote
      components={{
        pre: Code,
      }}
      source={`\`\`\` 

      const hi  MDX \`\`\``}
    />
  );
}
vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
bright ❌ Failed (Inspect) Apr 2, 2023 9:55am