Go to file
semantic-release-bot 224d729bd8 chore(release): 15.0.2 [skip ci]
## [15.0.2](https://github.com/markedjs/marked/compare/v15.0.1...v15.0.2) (2024-11-20)

### Bug Fixes

* update punctuation regex syntax for compatibility ([#3540](https://github.com/markedjs/marked/issues/3540)) ([fd015f1](fd015f147d))
2024-11-20 23:18:06 +00:00
.devcontainer chore: add .devcontainer config (#2700) 2023-01-08 00:07:35 -06:00
.github chore(ci): Publish with Provenance (#3305) 2024-05-29 11:29:20 -06:00
api chore: consolidate eslint rules (#3368) 2024-07-14 18:54:46 -06:00
bin fix: kill SIGINT signal at man for marked --help (#3483) 2024-10-14 22:24:19 -06:00
docs fix: Remove unused plus typescript tightening (#3527) 2024-11-17 21:53:28 -07:00
man feat: add --no-clobber option to CLI (#3025) 2023-10-04 20:05:55 -06:00
src fix: update punctuation regex syntax for compatibility (#3540) 2024-11-20 16:12:10 -07:00
test fix: Remove unused plus typescript tightening (#3527) 2024-11-17 21:53:28 -07:00
.editorconfig style 2018-04-05 11:36:07 -04:00
.gitattributes chore(git): mark lib/* as generated in .gitattributes (#2908) 2023-07-31 17:43:35 -04:00
.gitignore feat: add provideLexer and provideParser hooks (#3424) 2024-08-25 21:53:46 -06:00
.releaserc.json chore: rename release config 2021-11-02 09:40:27 -05:00
CHANGELOG.md chore: add changelog that points to releases (#3207) 2024-03-01 22:30:34 -07:00
eslint.config.js chore: use @markedjs/eslint-config (#3391) 2024-08-05 15:41:23 -06:00
LICENSE.md chore(docs): update versioning and other docs (#1834) 2020-11-18 14:20:03 -06:00
package-lock.json chore(release): 15.0.2 [skip ci] 2024-11-20 23:18:06 +00:00
package.json chore(release): 15.0.2 [skip ci] 2024-11-20 23:18:06 +00:00
README.md docs: Remove gzip size badge (#3512) 2024-10-29 06:03:19 -06:00
rollup.config.js chore: consolidate eslint rules (#3368) 2024-07-14 18:54:46 -06:00
SECURITY.md docs: Update authors link in SECURITY.md (#3013) 2023-09-28 07:32:42 -06:00
tsconfig-type-test.json fix: fix more types (#2893) 2023-08-19 16:55:56 -06:00
tsconfig.json fix: noImplicitAny: true (#2891) 2023-08-09 23:33:46 -06:00
vercel.json Use cleanUrls 2020-08-29 17:55:07 -04:00

Marked

npm install size downloads github actions snyk

  • 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
  • 🌐 works in a browser, on a server, or from a command line interface (CLI)

Demo

Checkout 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: Not IE11 :)

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

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/marked.min.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) 2011-2022, Christopher Jeffrey. (MIT License)