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:
@@ -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 }} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user