Update content rendering method in Keystatic package

This commit changes the way content is handled in the Keystatic package. It introduces rendering the content to HTML in the Keystatic client rather than in the content renderer component. This simplifies the rendering processing and better utilises the properties of the Markdoc library.
This commit is contained in:
giancarlo
2024-05-07 20:07:09 +07:00
parent 951acd38a5
commit d06882898a
3 changed files with 8 additions and 9 deletions

View File

@@ -1,7 +1,3 @@
import * as React from 'react';
const Markdoc = await import('@markdoc/markdoc');
export function KeystaticDocumentRenderer({ content }: { content: unknown }) {
return Markdoc.renderers.react(content as string, React);
export function KeystaticContentRenderer(props: { content: unknown }) {
return <div dangerouslySetInnerHTML={{ __html: props.content as string }} />;
}