2018-04-06 00:47:03 +00:00
< a href = "https://marked.js.org" >
< img width = "60px" height = "60px" src = "https://marked.js.org/img/logo-black.svg" align = "right" / >
< / a >
2018-02-25 23:09:11 +00:00
2018-04-05 21:15:11 +00:00
# Marked
2018-02-25 19:18:59 +00:00
2018-08-06 18:22:35 +00:00
[![npm ](https://badgen.net/npm/v/marked )](https://www.npmjs.com/package/marked)
2018-09-10 17:52:03 +00:00
[![gzip size ](https://badgen.net/badgesize/gzip/https://cdn.jsdelivr.net/npm/marked/marked.min.js )](https://cdn.jsdelivr.net/npm/marked/marked.min.js)
2018-08-06 23:36:38 +00:00
[![install size ](https://badgen.net/packagephobia/install/marked )](https://packagephobia.now.sh/result?p=marked)
2018-08-06 18:22:35 +00:00
[![downloads ](https://badgen.net/npm/dt/marked )](https://www.npmjs.com/package/marked)
2020-04-01 05:53:50 +00:00
[![github actions ](https://github.com/markedjs/marked/workflows/Tests/badge.svg )](https://github.com/markedjs/marked/actions)
2019-02-18 13:57:18 +00:00
[![snyk ](https://snyk.io/test/npm/marked/badge.svg )](https://snyk.io/test/npm/marked)
2018-04-15 22:29:57 +00:00
2018-04-05 21:15:11 +00:00
- ⚡ built for speed
2018-04-06 20:12:17 +00:00
- ⬇️ low-level compiler for parsing markdown without caching or blocking for long periods of time
2018-04-05 21:15:11 +00:00
- ⚖️ light-weight while implementing all markdown features from the supported flavors & specifications
2018-04-06 20:12:17 +00:00
- 🌐 works in a browser, on a server, or from a command line interface (CLI)
2018-02-25 19:18:59 +00:00
2018-03-26 00:46:27 +00:00
## Demo
2018-03-27 12:44:02 +00:00
Checkout the [demo page ](https://marked.js.org/demo/ ) to see marked in action ⛹️
2018-03-26 00:46:27 +00:00
2018-04-05 21:15:11 +00:00
## Docs
2018-03-26 00:46:27 +00:00
Our [documentation pages ](https://marked.js.org ) are also rendered using marked 💯
2018-07-17 21:47:31 +00:00
Also read about:
2018-07-18 20:54:29 +00:00
* [Options ](https://marked.js.org/#/USING_ADVANCED.md )
* [Extensibility ](https://marked.js.org/#/USING_PRO.md )
2018-07-17 21:47:31 +00:00
2021-08-16 14:19:44 +00:00
## Compatibility
**Node.js:** Only [current and LTS ](https://nodejs.org/en/about/releases/ ) Node.js versions are supported. End of life Node.js versions may become incompatible with Marked at any point in time.
**Browser:** Not IE11 :)
2018-03-11 21:32:23 +00:00
## Installation
2013-06-28 18:54:34 +00:00
2018-02-25 20:17:16 +00:00
**CLI:** `npm install -g marked`
2016-07-08 19:04:04 +00:00
2019-02-18 22:37:46 +00:00
**In-browser:** `npm install marked`
2016-07-08 19:04:04 +00:00
2018-06-24 06:56:52 +00:00
## Usage
2019-06-28 23:43:18 +00:00
### 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! 🚨
2013-06-28 18:54:34 +00:00
2018-02-25 20:17:16 +00:00
**CLI**
2013-06-28 18:54:34 +00:00
2018-02-25 20:17:16 +00:00
``` bash
$ marked -o hello.html
hello world
^D
$ cat hello.html
< p > hello world< / p >
2013-06-28 18:54:34 +00:00
```
2018-02-25 20:17:16 +00:00
**Browser**
2014-05-06 13:48:15 +00:00
```html
<!doctype html>
< html >
< head >
< meta charset = "utf-8" / >
< title > Marked in the browser< / title >
< / head >
< body >
< div id = "content" > < / div >
2018-03-26 00:36:41 +00:00
< script src = "https://cdn.jsdelivr.net/npm/marked/marked.min.js" > < / script >
2014-05-06 13:48:15 +00:00
< script >
document.getElementById('content').innerHTML =
2018-03-11 21:32:23 +00:00
marked('# Marked in the browser\n\nRendered by **marked** .');
2014-05-06 13:48:15 +00:00
< / script >
< / body >
< / html >
```
2018-03-11 21:32:23 +00:00
## License
2012-01-03 06:35:47 +00:00
2017-12-25 22:53:35 +00:00
Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License)