We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I try to implement this into my next js project using app next js version.
And I wanna try to test the security using this inside the string markdown;
<IFRAME SRC="javascript:javascript:alert(window.origin);"></IFRAME>
And this is my code.
import "@uiw/react-md-editor/markdown-editor.css"; import "@uiw/react-markdown-preview/markdown.css"; import { useState } from "react"; import MDEditor from "@uiw/react-md-editor"; import rehypeSanitize from "rehype-sanitize"; const PostEditor = () => { const [value, setValue] = useState<string | undefined>( '**Hello world!!!** <IFRAME SRC="javascript:javascript:alert(window.origin);"></IFRAME>' ); return ( <div className="container"> <MDEditor value={value} onChange={setValue} previewOptions={{ rehypePlugins: [rehypeSanitize], transformLinkUri: null, skipHtml: true, }} /> <MDEditor.Markdown source={value} style={{ whiteSpace: "pre-wrap" }} /> </div> ); }; export default PostEditor;
And then javascript dialog still up there. How to avoid that dialog appear to our website, especially during production.
The text was updated successfully, but these errors were encountered:
Those are two different components. The separate viewer needs it's own rehypeSanitize. This should work.
<MDEditor.Markdown source={value} rehypePlugins={[rehypeSanitize]} />
Sorry, something went wrong.
No branches or pull requests
I try to implement this into my next js project using app next js version.
And I wanna try to test the security using this inside the string markdown;
And this is my code.
And then javascript dialog still up there.

How to avoid that dialog appear to our website, especially during production.
The text was updated successfully, but these errors were encountered: