semantic-release-bot 73d5116de4 chore(release): 18.2.1 [skip ci]
## [18.2.1](https://github.com/markedjs/marked/compare/v18.2.0...v18.2.1) (2026-11-16)

### Bug Fixes

* allow tabs between the tag name and attributes of an html block ([#4207](https://github.com/markedjs/marked/issues/4207)) ([738ebeb](https://github.com/markedjs/marked/commit/738ebebc835ebc97fe82e3321bc7f91f638c531f))
* **cli:** wait for stdout before exiting ([#4197](https://github.com/markedjs/marked/issues/4197)) ([b535046](https://github.com/markedjs/marked/commit/b535046bf59cbe488be4354f02d56b1a1bb6fdaa))
* continue a block quote paragraph with a lazy line that starts an html tag ([#4202](https://github.com/markedjs/marked/issues/4202)) ([8a578e4](https://github.com/markedjs/marked/commit/8a578e4c0c7e1c650a6bad82254d30b0d377c730))
* end a block quote at a lazy line after an empty list item ([#4178](https://github.com/markedjs/marked/issues/4178)) ([e2f77b4](https://github.com/markedjs/marked/commit/e2f77b4b72ccaefeb99fc74df2bfd7016636c3b2))
* end a list item before a lazy line after an empty or non-paragraph nested block ([#4183](https://github.com/markedjs/marked/issues/4183)) ([ac2256e](https://github.com/markedjs/marked/commit/ac2256e1130957341831a8308f73720ede7e6095))
* Fix bracket escapes inside code spans in link text being stripped ([#4205](https://github.com/markedjs/marked/issues/4205)) ([9a26ae9](https://github.com/markedjs/marked/commit/9a26ae9ceeb26f79f35a03ec910f996147087ef8)), closes [#4176](https://github.com/markedjs/marked/issues/4176) [#4176](https://github.com/markedjs/marked/issues/4176) [#4176](https://github.com/markedjs/marked/issues/4176)
* keep a tab after the block quote marker's space literal ([#4208](https://github.com/markedjs/marked/issues/4208)) ([2d3b47f](https://github.com/markedjs/marked/commit/2d3b47fa217a06f9a360d86ebf0f766d19949621))
* keep rejected table candidates in the preceding paragraph ([#4218](https://github.com/markedjs/marked/issues/4218)) ([1c5969e](https://github.com/markedjs/marked/commit/1c5969e395905fa3f33f3a847d8ad655f1dfcce7))
* keep tabs that are code content under a block quote ([#4217](https://github.com/markedjs/marked/issues/4217)) ([d2c6f73](https://github.com/markedjs/marked/commit/d2c6f736f339b4739a16426c681528ca210a6e87)), closes [#4184](https://github.com/markedjs/marked/issues/4184)
* let a mid-run opener close against a delimiter that can also open ([#4203](https://github.com/markedjs/marked/issues/4203)) ([06e1d10](https://github.com/markedjs/marked/commit/06e1d1090338b76c3d458a26d52ee67f72c8d6e1))
* let an autolink or inline html line start or continue a setext heading ([#4191](https://github.com/markedjs/marked/issues/4191)) ([72d0fec](https://github.com/markedjs/marked/commit/72d0fec9b59a12c5446b9377cf4363a2794ce54b))
* parse links generated by inline tokenizers ([#4204](https://github.com/markedjs/marked/issues/4204)) ([0460f98](https://github.com/markedjs/marked/commit/0460f98b7e2a1dfedf40eccddaa8d8ada1731d2a))
* preserve trailing blank lines in fenced code ([#4200](https://github.com/markedjs/marked/issues/4200)) ([7499eb3](https://github.com/markedjs/marked/commit/7499eb3a23eb29c0e9d2ffde551b92439a9b3af6))
* reject a link destination in angle brackets with an unescaped < or > ([#4206](https://github.com/markedjs/marked/issues/4206)) ([de71210](https://github.com/markedjs/marked/commit/de71210d4204745b326d2e8357240f7a350221f8))
* remove a task item's checkbox marker from its own text ([#4215](https://github.com/markedjs/marked/issues/4215)) ([5902442](https://github.com/markedjs/marked/commit/59024421a4ce874168d3f551565f4ebad121f5af))
* **types:** preserve custom output types in tokenizer overrides ([#4214](https://github.com/markedjs/marked/issues/4214)) ([5e35708](https://github.com/markedjs/marked/commit/5e35708f3f4a88d477c37c2d42ad86907d6b4daf))

### Performance Improvements

* check the first character before inline tokenizer regexes ([#4193](https://github.com/markedjs/marked/issues/4193)) ([95ccf6c](https://github.com/markedjs/marked/commit/95ccf6c186a38e092dfb666d68f70cfcd89c53a5))
* close residual O(n²) parse time on unmatched emphasis/strikethrough delimiter runs (follow-up to [#4099](https://github.com/markedjs/marked/issues/4099) / [#4103](https://github.com/markedjs/marked/issues/4103)) ([#4196](https://github.com/markedjs/marked/issues/4196)) ([0b8b3b3](https://github.com/markedjs/marked/commit/0b8b3b33863822681a1cb5a365baec684c368230))
* skip the emphasis closer scan for inline runs without a delimiter ([#4195](https://github.com/markedjs/marked/issues/4195)) ([ffa06d5](https://github.com/markedjs/marked/commit/ffa06d52ce67f952e0c50ccc7371f50cfe27cfc6))
2026-11-16 17:20:37 +00:00
2026-10-31 12:34:33 -06:00
2021-11-02 09:40:27 -05:00
2026-11-16 17:20:37 +00:00
2023-08-09 23:33:46 -06:00
2020-08-29 17:55:07 -04:00

Marked

npm install size downloads github actions snyk inspect.software

  • ⚡ 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

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)

S
Description
Lustro github.com/markedjs/marked
Readme Multiple Licenses
22 MiB
Languages
TypeScript 37.1%
JavaScript 36.6%
HTML 26.3%