Skip to content

Commit d620fe7

Browse files
authored
fix(yfmHtmlBlock): added sanitize prop to YfmHtmlBlock wysiwyg extension (#304)
1 parent 2a13a60 commit d620fe7

File tree

1 file changed

+3
-2
lines changed
  • src/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockSpecs

1 file changed

+3
-2
lines changed

src/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockSpecs/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ export {yfmHtmlBlockNodeName} from './const';
99

1010
export type YfmHtmlBlockSpecsOptions = {
1111
nodeView?: ExtensionNodeSpec['view'];
12+
sanitize?: (dirtyHtml: string) => string;
1213
};
1314

1415
const YfmHtmlBlockSpecsExtension: ExtensionAuto<YfmHtmlBlockSpecsOptions> = (
1516
builder,
16-
{nodeView},
17+
{nodeView, sanitize},
1718
) => {
1819
builder
19-
.configureMd((md) => md.use(transform({bundle: false}), {}))
20+
.configureMd((md) => md.use(transform({bundle: false, sanitize}), {}))
2021
.addNode(YfmHtmlBlockConsts.NodeName, () => ({
2122
fromMd: {
2223
tokenSpec: {

0 commit comments

Comments
 (0)