diff --git a/package.json b/package.json index 6bbfaf5f2..a2c3e366c 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,7 @@ "dependencies": { "@babel/runtime": "^7.14.6", "@uiw/react-markdown-preview": "3.4.4", + "rehype-sanitize": "5.0.1", "rehype": "12.0.0" }, "keywords": [ diff --git a/website/Exmaple.tsx b/website/Exmaple.tsx index 849f65b90..cfd1598aa 100644 --- a/website/Exmaple.tsx +++ b/website/Exmaple.tsx @@ -1,4 +1,5 @@ import React, { Fragment } from 'react'; +import rehypeSanitize from 'rehype-sanitize'; import MDEditor, { MDEditorProps } from '../'; let count = 1; @@ -25,6 +26,7 @@ const Exmaple = (props = {} as { mdStr: string }) => { value={state.value} previewOptions={{ linkTarget: '_blank', + rehypePlugins: [rehypeSanitize], }} height={400} highlightEnable={state.highlightEnable}