mirror of
https://github.com/markedjs/marked
synced 2024-11-22 17:37:24 +00:00
chore(docs): add a secure example to the documentation. (#2462)
* Add a sanitized example * Remove ! * move example below warning Co-authored-by: Florian Hantke <florian.hantke@cispa.de>
This commit is contained in:
parent
50dbfac729
commit
74ccecf771
@ -43,11 +43,14 @@ Also read about:
|
||||
|
||||
## Usage
|
||||
|
||||
### Warning: 🚨 Marked does not [sanitize](https://marked.js.org/#/USING_ADVANCED.md#options) the output HTML. Please use a sanitize library, like [DOMPurify](https://github.com/cure53/DOMPurify) (recommended), [sanitize-html](https://github.com/apostrophecms/sanitize-html) or [insane](https://github.com/bevacqua/insane) on the output HTML! 🚨
|
||||
### Warning: 🚨 Marked does not [sanitize](https://marked.js.org/#/USING_ADVANCED.md#options) the output HTML. Please use a sanitize library, like [DOMPurify](https://github.com/cure53/DOMPurify) (recommended), [sanitize-html](https://github.com/apostrophecms/sanitize-html) or [insane](https://github.com/bevacqua/insane) on the *output* HTML! 🚨
|
||||
|
||||
```
|
||||
DOMPurify.sanitize(marked.parse(`<img src="x" onerror="alert('not happening')">`));
|
||||
```
|
||||
|
||||
**CLI**
|
||||
|
||||
|
||||
``` bash
|
||||
# Example with stdin input
|
||||
$ marked -o hello.html
|
||||
|
@ -25,7 +25,11 @@ These documentation pages are also rendered using marked 💯
|
||||
|
||||
<h2 id="usage">Usage</h2>
|
||||
|
||||
### Warning: 🚨 Marked does not [sanitize](/using_advanced#options) the output HTML. Please use a sanitize library, like [DOMPurify](https://github.com/cure53/DOMPurify) (recommended), [sanitize-html](https://github.com/apostrophecms/sanitize-html) or [insane](https://github.com/bevacqua/insane) on the output HTML! 🚨
|
||||
### Warning: 🚨 Marked does not [sanitize](/using_advanced#options) the output HTML. Please use a sanitize library, like [DOMPurify](https://github.com/cure53/DOMPurify) (recommended), [sanitize-html](https://github.com/apostrophecms/sanitize-html) or [insane](https://github.com/bevacqua/insane) on the *output* HTML! 🚨
|
||||
|
||||
```
|
||||
DOMPurify.sanitize(marked.parse(`<img src="x" onerror="alert('not happening')">`));
|
||||
```
|
||||
|
||||
**CLI**
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user