mirror of
https://github.com/markedjs/marked.git
synced 2026-11-30 16:48:05 +01:00
cdbdc0122ab83b2b97560944bf009a22cfb78b05
## [18.1.1](https://github.com/markedjs/marked/compare/v18.1.0...v18.1.1) (2026-10-12) ### Bug Fixes * **cli:** honor an explicitly empty string input ([#4113](https://github.com/markedjs/marked/issues/4113)) ([ec3a4e5](https://github.com/markedjs/marked/commit/ec3a4e511aa0d60b3e9ab8aa0c769407cdaf08d9)) * end blockquote before a lazy line after a heading, hr or html block ([#4115](https://github.com/markedjs/marked/issues/4115)) ([9e64a6a](https://github.com/markedjs/marked/commit/9e64a6a3fe6b826d113fc337c21ebe345455a842)) * keep a backslash in a code span from hiding emphasis ([#4117](https://github.com/markedjs/marked/issues/4117)) ([6a57018](https://github.com/markedjs/marked/commit/6a57018fc906333d358981682fd693e4bb85940f)) * keep a decoded character reference from forming a new one ([#4111](https://github.com/markedjs/marked/issues/4111)) ([6bbac0c](https://github.com/markedjs/marked/commit/6bbac0cdb72cc3038baefe768c03f788e46126a5)), closes [#38](https://github.com/markedjs/marked/issues/38) [#112](https://github.com/markedjs/marked/issues/112) * let indented and type 3-5 html blocks interrupt a paragraph ([#4124](https://github.com/markedjs/marked/issues/4124)) ([eaa1fff](https://github.com/markedjs/marked/commit/eaa1fffb30fa334cc11ab93f1e5aaa1d2b916e7c)) * make walkTokens linear by appending values in place ([#4121](https://github.com/markedjs/marked/issues/4121)) ([627d9ae](https://github.com/markedjs/marked/commit/627d9ae4e5ea403580782a8f6e21fbc8bf56f4c1)), closes [#4120](https://github.com/markedjs/marked/issues/4120) * match pre, script, style and textarea as whole tag names ([#4114](https://github.com/markedjs/marked/issues/4114)) ([0db74cb](https://github.com/markedjs/marked/commit/0db74cb0194f3acb5a53b14a73c2cd087c3c9981)) * preserve enclosing link state after parsing images ([#4123](https://github.com/markedjs/marked/issues/4123)) ([cc07bb9](https://github.com/markedjs/marked/commit/cc07bb9cb62bfd41a724d0a426f194188d7b35c1)) * respect tab stops in list continuation indentation ([#4119](https://github.com/markedjs/marked/issues/4119)) ([4bd2528](https://github.com/markedjs/marked/commit/4bd252811fb24ca6b7e22f60c39b89efc2b265d2)) ### Performance Improvements * avoid repeated raw string copies in nested lists ([#4082](https://github.com/markedjs/marked/issues/4082)) ([7e8754d](https://github.com/markedjs/marked/commit/7e8754d60b3c37be30aa17106ada623d1f0cf9db))
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%