Open 2820402 opened 1 month ago
import { serialize } from 'next-mdx-remote/serialize'; import rehypeSanitize, { defaultSchema } from 'rehype-sanitize'; const schema = { ...defaultSchema, tagNames: [ ...defaultSchema.tagNames!, 'Callout', ], attributes: { ...defaultSchema.attributes, Callout: ['*'], }, }; const source = "<Callout emoji='💡'>Testing</Callout>" const mdxSource = await serialize(source, { mdxOptions: { remarkPlugins: [remarkGfm], rehypePlugins: [ [ rehypeSanitize, { schema: schema, }, ], ], format: 'mdx', }, }); console.log(mdxSource) // empty don't have Callout component
Is there is a way to render that component while using rehype-sanitize
the version I use is
"rehype-sanitize": "^6.0.0", "next-mdx-remote": "^5.0.0",
Is there is a way to render that component while using rehype-sanitize
the version I use is