Add 'use server' directive to markdown renderer (#3815)

This commit is contained in:
conico974
2025-11-20 09:28:00 +01:00
committed by GitHub
parent 344842f5ce
commit 2989f79708
@@ -27,7 +27,10 @@ export const contentKitServerContext: ContentKitServerContext = {
codeBlock: (props) => {
return <PlainCodeBlock code={props.code} syntax={props.syntax} />;
},
// For some reason, Next thinks that this function is used in a client component
// it's likely an issue with the compiler not being able to track the usage of this function properly
markdown: async ({ className, markdown }) => {
'use server';
const parsed = await parseMarkdown(markdown);
return <div className={className} dangerouslySetInnerHTML={{ __html: parsed }} />;
},