mirror of
https://github.com/markedjs/marked.git
synced 2026-11-30 16:48:05 +01:00
v18.1.3
## [18.1.3](https://github.com/markedjs/marked/compare/v18.1.2...v18.1.3) (2026-11-02) ### Bug Fixes * allow trailing tabs after a setext heading underline ([#4152](https://github.com/markedjs/marked/issues/4152)) ([1f1b480](https://github.com/markedjs/marked/commit/1f1b480a29644a26e70ad63cd45343e439fb12e9)) * avoid quadratic scan for unmatched emphasis delimiters ([#4103](https://github.com/markedjs/marked/issues/4103)) ([eab1e48](https://github.com/markedjs/marked/commit/eab1e483fe88e559288d3003d493bbc0ec4ecf53)), closes [#4099](https://github.com/markedjs/marked/issues/4099) * await promise arrays from walkTokens extensions ([#4153](https://github.com/markedjs/marked/issues/4153)) ([c38704c](https://github.com/markedjs/marked/commit/c38704c2faa07f9d68b278133ec668039d58149b)) * **cli:** honor defaults and config when outputting tokens ([#4146](https://github.com/markedjs/marked/issues/4146)) ([9470e8f](https://github.com/markedjs/marked/commit/9470e8f719d6b276065e277de5d9f8bca7c35c4a)) * collapse internal whitespace when normalizing link labels ([#4157](https://github.com/markedjs/marked/issues/4157)) ([02c73e8](https://github.com/markedjs/marked/commit/02c73e8e659d369f4baba41903be3ddde128f15c)) * do not allow a blank line inside a link reference definition label ([#4165](https://github.com/markedjs/marked/issues/4165)) ([f3d21af](https://github.com/markedjs/marked/commit/f3d21af0706fd6f10998e838e0841c39603689cc)) * don't treat an escaped ) or quote as an inline link or title closer ([#4151](https://github.com/markedjs/marked/issues/4151)) ([9cb84e0](https://github.com/markedjs/marked/commit/9cb84e07d18833a241f3df13d7419596f5b203ff)) * end a list item before a lazy line after an html block ([#4159](https://github.com/markedjs/marked/issues/4159)) ([7ba42f4](https://github.com/markedjs/marked/commit/7ba42f445cd88286dbad4e4104e6b3842ed814b5)) * end blockquote before a lazy line after a table ([#4161](https://github.com/markedjs/marked/issues/4161)) ([e7dcf52](https://github.com/markedjs/marked/commit/e7dcf52ddbf88171e630ec1b88d8242d67b29e0b)) * isolate extension names from Object.prototype ([#4177](https://github.com/markedjs/marked/issues/4177)) ([5cb03bd](https://github.com/markedjs/marked/commit/5cb03bd9a293976c8dd3099274cff161b08f5cb0)) * keep a block quote open after a lazy line in a nested block quote ([#4175](https://github.com/markedjs/marked/issues/4175)) ([1d7272f](https://github.com/markedjs/marked/commit/1d7272f9ca02cdef3fb2ad061fa4da38b8978661)) * only close a code fence with the opening fence character ([#4164](https://github.com/markedjs/marked/issues/4164)) ([1d4d8fe](https://github.com/markedjs/marked/commit/1d4d8fe6f5ed2a4ead1a75bf67627318ca92115a)) * preserve zero-valued custom renderer results ([#4162](https://github.com/markedjs/marked/issues/4162)) ([e43ceef](https://github.com/markedjs/marked/commit/e43ceef44a981a620072252c021f43f4e5395fc4)) * recognize task list items when a tab follows the checkbox ([#4163](https://github.com/markedjs/marked/issues/4163)) ([64a299d](https://github.com/markedjs/marked/commit/64a299def97ab8d2aa0c92458585ee894c247a5d)) * start a GFM www autolink only at a word boundary ([#4166](https://github.com/markedjs/marked/issues/4166)) ([84beefb](https://github.com/markedjs/marked/commit/84beefb3eb24dbf25c526467a2a3906b9afe11e8)) ### Performance Improvements * fix backtracking in padantic html ([#4173](https://github.com/markedjs/marked/issues/4173)) ([2d4a23c](https://github.com/markedjs/marked/commit/2d4a23c50e5c4fe64de67762d19a0c9741a811d4))
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%