-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
"@gravity-ui/markdown-editor": "^15.11.0"
In hte doc How to add HTML extension: https://preview.gravity-ui.com/md-editor/?path=/docs/docs-extensions-html-block--docs, The code inside cannot be executed and all errors are reported,please update this doc demo,tell me How to integrate YFM HTML block extension?
For example
// render
const HtmlRenderer = React.forwardRef<HTMLDivElement, HtmlRendererProps>((props, ref) => {
// ...
const theme = useThemeType(); // your hook for get theme
const yfmHtmlBlockConfig = useYfmHtmlBlockStyles();
() => ({
theme,
zoom: {showMenu: true, bindKeys: true, resetOnBlur: true},
}),
[theme],
);
// ...
return (
<div>
<YfmStaticView
html={html}
meta={meta}
ref={elementRef}
yfmHtmlBlockConfig={yfmHtmlBlockConfig}
/>
{props.children}
</div>
);
});
() => ({
theme,
zoom: {showMenu: true, bindKeys: true, resetOnBlur: true},
}),
[theme],
);
what this in the react component?
- markdown-editor/src/extensions/additional//index.ts
only export GPT
export * from './GPT';
not export yfmHtmlBlock
Metadata
Metadata
Assignees
Labels
No labels