astro/packages/integrations/markdoc/components/Renderer.astro
Ben Holmes 57e65d247f
revert: markdoc asset bleed (#7178)
* revert: markdoc asset bleed

* chore: changeset
2023-05-23 12:16:50 -04:00

17 lines
431 B
Text

---
import type { Config } from '@markdoc/markdoc';
import Markdoc from '@markdoc/markdoc';
import { ComponentNode, createTreeNode } from './TreeNode.js';
type Props = {
config: Config;
stringifiedAst: string;
};
const { stringifiedAst, config } = Astro.props as Props;
const ast = Markdoc.Ast.fromJSON(stringifiedAst);
const content = Markdoc.transform(ast, config);
---
<ComponentNode treeNode={createTreeNode(content)} />