Refactor to support custom Markdoc components (#52)

* Refactor to support custom Markdoc components

Introduced a new file for custom Markdoc components and updated the client to render Markdoc content using React components. Modified content renderer to handle React nodes instead of dangerously setting inner HTML.

* Add custom Markdoc tags support in Keystatic

Introduced `CustomMarkdocTags` for defining user tags. Updated `transform` to accommodate the new custom tags, enhancing tag customization in the CMS.
This commit is contained in:
Giancarlo Buomprisco
2024-08-22 04:34:10 +08:00
committed by GitHub
parent 2afa736f4c
commit 1d10dd210a
3 changed files with 48 additions and 4 deletions

View File

@@ -1,3 +1,3 @@
export function KeystaticContentRenderer(props: { content: unknown }) {
return <div dangerouslySetInnerHTML={{ __html: props.content as string }} />;
return <div>{props.content as React.ReactNode}</div>;
}