Skip to content

Commit 2520e88

Browse files
committed
doc: update example #649
1 parent 9ca4bd9 commit 2520e88

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

core/README.md

+24
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,30 @@ export default function App() {
583583
}
584584
```
585585

586+
### Disallowed Elements
587+
588+
```jsx mdx:preview
589+
import React from "react";
590+
import MDEditor from '@uiw/react-md-editor';
591+
592+
export default function App() {
593+
const [value, setValue] = React.useState("**Hello world!!!** <style>body{display:none;}</style> ");
594+
return (
595+
<div className="container">
596+
<MDEditor
597+
value={value}
598+
height="100%"
599+
previewOptions={{
600+
disallowedElements: ['style'],
601+
}}
602+
visibleDragbar={false}
603+
onChange={setValue}
604+
/>
605+
</div>
606+
);
607+
}
608+
```
609+
586610
### Preview Markdown
587611

588612
[![Open in CodeSandbox](https://img.shields.io/badge/Open%20in-CodeSandbox-blue?logo=codesandbox)](https://codesandbox.io/embed/react-md-editor-preview-markdown-vrucl?fontsize=14&hidenavigation=1&theme=dark)

0 commit comments

Comments
 (0)