mirror of
https://github.com/markedjs/marked.git
synced 2026-11-30 16:48:05 +01:00
v18.3.0
# [18.3.0](https://github.com/markedjs/marked/compare/v18.2.1...v18.3.0) (2026-11-24) ### Bug Fixes * allow trailing tabs after closing code fences ([#4241](https://github.com/markedjs/marked/issues/4241)) ([1e11902](https://github.com/markedjs/marked/commit/1e1190241b4a8f16d6bfa232e183f581eb617964)) * avoid quadratic scan on adjacent inline links ([#4274](https://github.com/markedjs/marked/issues/4274)) ([f5ffd22](https://github.com/markedjs/marked/commit/f5ffd221ba5fc7f077d867ac2fc3f7a06855da94)) * avoid quadratic time on long local part before @ in GFM text ([#4225](https://github.com/markedjs/marked/issues/4225)) ([c6b22e8](https://github.com/markedjs/marked/commit/c6b22e89baca9dfa4ed074380a511781e1c35e4a)) * check own properties on extensions.renderers in Parser ([#4271](https://github.com/markedjs/marked/issues/4271)) ([c572307](https://github.com/markedjs/marked/commit/c57230757e32a2b27c4bc75b1274b25e379fd465)) * honor the CLI end-of-options marker ([#4230](https://github.com/markedjs/marked/issues/4230)) ([a1ddc72](https://github.com/markedjs/marked/commit/a1ddc722e797b8315a56ea2ab66043da294364af)) * keep an indented code block after a list item paragraph ([#4198](https://github.com/markedjs/marked/issues/4198)) ([b9e3824](https://github.com/markedjs/marked/commit/b9e3824233a381aa476ae9a9d9c4827fb25c601c)) * preserve literal entities in image alt text ([#4232](https://github.com/markedjs/marked/issues/4232)) ([04f1c6e](https://github.com/markedjs/marked/commit/04f1c6e5189076d38b00d41acf9bff235532123a)) * reject CLI options missing their values ([#4261](https://github.com/markedjs/marked/issues/4261)) ([502e658](https://github.com/markedjs/marked/commit/502e658115a8db1aec6157c2560cde913b78c4f6)) * skip missing optional childTokens properties in walkTokens ([#4262](https://github.com/markedjs/marked/issues/4262)) ([283f74f](https://github.com/markedjs/marked/commit/283f74f24bc6df1c39c4b2a74ef923a68752e6e5)) * wait for CLI error output before exiting ([#4263](https://github.com/markedjs/marked/issues/4263)) ([6c2a5ab](https://github.com/markedjs/marked/commit/6c2a5ab48d475d66adb19d2909929a6447130c52)) ### Features * add inBlockquote to lexer state ([#4222](https://github.com/markedjs/marked/issues/4222)) ([201bfce](https://github.com/markedjs/marked/commit/201bfce495e6e57be6f2c91e822e65f33a546040)), closes [#4184](https://github.com/markedjs/marked/issues/4184) [#4221](https://github.com/markedjs/marked/issues/4221) ### Performance Improvements * avoid scanning table bodies for header-only decisions ([#4213](https://github.com/markedjs/marked/issues/4213)) ([a0925cc](https://github.com/markedjs/marked/commit/a0925cca0227082e83feb2461115fbef1a30ecca)) * skip paragraph lookahead for initial quoted code ([#4233](https://github.com/markedjs/marked/issues/4233)) ([171f177](https://github.com/markedjs/marked/commit/171f177a42f09d4812c68b045c3bb50122f6b2aa))
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%