Renders the preview of your markdown as you type
- React -
create-react-app
to scaffold the project - Marked - The markdown parser and compiler behind this project
- DOMPurify - It sanitizes, that is, strips out dangerous HTML, thus preventing XSS attacks.
# Title
becomes <h1>Title</h1>
[Link](https://github.com/13thThief/markdown-previewer)
becomes Link
- Interprets carriage returns and renders them as
<br>
(line break) elements - Render links with
target="_blank" rel="noopener noreferrer"
- Sanitization support
Sanitization example:
`<img src=x onerror=alert(1)/>` becomes `<img src="x">`
`<svg><g/onload=alert(2)//<p>` becomes `<svg><g></g></svg>`
`<p>abc<iframe/\/src=jAva	script:alert(3)>def</p>` becomes `<p>abcdef</p>`
`<math><mi//xlink:href="data:x,<script>alert(4)</script>">` becomes `<math><mi></mi></math>`
`<TABLE><tr><td>HELLO</tr></TABL>` becomes `<table><tbody><tr><td>HELLO</td></tr></tbody></table>`
`<UL><li><A HREF=//google.com>click</UL>` becomes `<ul><li><a href="//google.com">click</a></li></ul>`
Inspired by Stackedit.io
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.