markedjs /marked
A markdown parser and compiler. Built for speed.
★ 37,303⑂ 3,829👁 377⑃ 2,353● 1,698▤ 188
-1
日增长
+8
周增长
37,303
stars
3,829
forks
377
watchers
2,353
prs
1,698
issues
188
releases
README
Marked
- ⚡ built for speed
- ⬇️ low-level compiler for parsing markdown without caching or blocking for long periods of time
- ⚖️ light-weight while implementing all markdown features from the supported flavors & specifications
- 🛠️ easily adaptable with custom extensions
- 🌐 works in a browser, on a server, or from a command line interface (CLI)
Demo
Check out the demo page to see Marked in action ⛹️
Docs
Our documentation pages are also rendered using marked 💯
Also read about:
Options
Extensibility
Compatibility
Node.js: Only current and LTS Node.js versions are supported. End of life Node.js versions may become incompatible with Marked at any point in time.
Browser: Baseline Widely Available
Installation
CLI:
sh
npm install -g marked
In-browser:
sh
npm install marked
Usage
Warning: 🚨 Marked does not sanitize the output HTML. Please use a sanitize library, like DOMPurify (recommended), sanitize-html or insane on the output HTML! 🚨
DOMPurify.sanitize(marked.parse());
CLI
bash
Example with stdin input
$ marked -o hello.html
hello world
^D
$ cat hello.html
hello world
bash
Print all options
$ marked --help
Node.js
js
import { marked } from 'marked';
const html = marked.parse(' Marked in Node.js');
console.log(html);
Browser
html
Marked in the browser
document.getElementById('content').innerHTML =
marked.parse(' Marked in the browser\n\nRendered by marked.');
or import esm module
html
import { marked } from "https://cdn.jsdelivr.net/npm/marked/lib/marked.esm.js";
document.getElementById('content').innerHTML =
marked.parse(' Marked in the browser\n\nRendered by marked.');
License
Copyright (c) 2018+, MarkedJS. (MIT License)
Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License)Top issues
#4050CommonMark spec gaps grouped by root cause, and a question about lookup tables21 comments · 2026-08-10#2355Measured performance decrease between major releases of Marked, time for a performance pass?12 comments · 2022-01-12#3435Support custom extensions "interrupting" built-in tokens4 comments · 2024-08-29#1225Markdown flavors + options3 comments · 2018-04-16#4184Tab inside a fenced code block in a block quote is expanded to spaces (regression in 18.1.2)2 comments · 2026-11-02#4176Code span inside link text drops the backslash or ends the link early (\], \[, backtick)2 comments · 2026-11-01#3996Bug: Architectural deviations from CommonMark specification2 comments · 2026-06-17#3590Select Extension priority2 comments · 2025-01-15
Discussions
#4210Should a rejected GFM table candidate split a paragraph?1 comments · 2026-11-09#4186Organization membership request after contributing #41771 comments · 2026-11-03#4143CurlShot API docs rendered with marked: async walkTokens for highlighting, TOC from the heading renderer0 comments · 2026-10-17#4136NOS: Markdown notes rendered with Marked, kept beside the HTML pages you share0 comments · 2026-10-12#3980Markdown is not LaTeX1 comments · 2026-05-27#3878How to pass walkTokens each time differently?1 comments · 2026-01-24#3845🍮 Vanilla(static)CMS – Content management system0 comments · 2025-11-23#3799Support for GitHub Admonitions (i.e. [!Tip] block and other blocks)?1 comments · 2025-10-11
Latest release
v18.2.0 v18.2.0 2026-11-0918.2.0 (2026-11-09) Bug Fixes keep hard line breaks in image alt text (4187) (ed54c54) let emphasis open after the other delimiter character (4169) (219492a) let emphasis open and close in angle brackets that are not html (4190) (7bfa1f7) preserve zero from named extension renderers (4199) (b81a00a) text after a heading or code block in a nested list item is pulled into the outer item (4179) (4cb767a) Features add lastToken to lexer state (4160) (e4ab77f)