mirror of
https://github.com/markedjs/marked.git
synced 2026-11-30 16:48:05 +01:00
v18.0.14
## [18.0.14](https://github.com/markedjs/marked/compare/v18.0.13...v18.0.14) (2026-09-22) ### Bug Fixes * allow indented lines in setext heading text ([#4095](https://github.com/markedjs/marked/issues/4095)) ([7d05530](https://github.com/markedjs/marked/commit/7d05530733fa3f3ec2ed912ff695d05af6d81b8a)) * decode numeric character references in text ([#4076](https://github.com/markedjs/marked/issues/4076)) ([cead8de](https://github.com/markedjs/marked/commit/cead8de96f2ee32d79e1de187bd099929f7409a8)) * keep text after empty nested blockquote ([#4101](https://github.com/markedjs/marked/issues/4101)) ([1b89557](https://github.com/markedjs/marked/commit/1b89557177fe5a7d5d430fdc76e7c8a7c0adf6d7)), closes [#4098](https://github.com/markedjs/marked/issues/4098) * preserve internal tabs in list item content ([#4086](https://github.com/markedjs/marked/issues/4086)) ([e136da7](https://github.com/markedjs/marked/commit/e136da7c7dedcb58af046086005f89350020c416)) * strip whitespace when normalizing link reference labels ([#4091](https://github.com/markedjs/marked/issues/4091)) ([c7ee43a](https://github.com/markedjs/marked/commit/c7ee43abecd6a9e024f8bb6818be2da05e5793cb)) * support GFM protocol autolinks ([#4067](https://github.com/markedjs/marked/issues/4067)) ([7f7a496](https://github.com/markedjs/marked/commit/7f7a49670c14acc6f11efcb18ecc69d17962477a))
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:
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:
npm install -g marked
In-browser:
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(`<img src="x" onerror="alert('not happening')">`));
CLI
# Example with stdin input
$ marked -o hello.html
hello world
^D
$ cat hello.html
<p>hello world</p>
# Print all options
$ marked --help
Node.js
import { marked } from 'marked';
const html = marked.parse('# Marked in Node.js');
console.log(html);
Browser
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>Marked in the browser</title>
</head>
<body>
<div id="content"></div>
<script src="https://cdn.jsdelivr.net/npm/marked/lib/marked.umd.js"></script>
<script>
document.getElementById('content').innerHTML =
marked.parse('# Marked in the browser\n\nRendered by **marked**.');
</script>
</body>
</html>
or import esm module
<script type="module">
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**.');
</script>
License
Copyright (c) 2018+, MarkedJS. (MIT License) Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License)
Languages
TypeScript
37.1%
JavaScript
36.6%
HTML
26.3%