A markdown parser and compiler. Built for speed.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
dependabot[bot] 5203b44da9
chore(deps-dev): Bump @babel/preset-env from 7.21.5 to 7.22.4 (#2823)
6 hours ago
.devcontainer chore: add .devcontainer config (#2700) 5 months ago
.github fix: update min node to v18 (#2767) 4 weeks ago
api chore: update dingus (#2624) 7 months ago
bin chore: added some jsdoc (#2418) 1 year ago
docs feat: add block param to html renderer (#2768) 4 weeks ago
lib 🗜️ build v5.0.3 [skip ci] 3 days ago
man fix: Convert to ESM (#2227) 2 years ago
src fix: fix quadratic execution in em mask (#2818) 3 days ago
test fix: fix quadratic execution in em mask (#2818) 3 days ago
.editorconfig style 5 years ago
.eslintignore fix eslint config 4 years ago
.eslintrc.json chore(dev-deps): remove eslint-plugin-standard (#1849) 3 years ago
.gitattributes chore: avoid linefeed errors running on windows (#2277) 2 years ago
.gitignore Copy license to docs 3 years ago
.releaserc.json chore: rename release config 2 years ago
LICENSE.md chore(docs): update versioning and other docs (#1834) 3 years ago
Makefile fix: Convert to ESM (#2227) 2 years ago
README.md docs: Info to install @types/marked for ts projects (#2577) 9 months ago
SECURITY.md Update SECURITY.md 3 years ago
bower.json fix: Convert to ESM (#2227) 2 years ago
build-docs.js chore: added some jsdoc (#2418) 1 year ago
component.json fix: Convert to ESM (#2227) 2 years ago
jasmine.json fix: Convert to ESM (#2227) 2 years ago
marked.min.js 🗜️ build v5.0.3 [skip ci] 3 days ago
package-lock.json chore(deps-dev): Bump @babel/preset-env from 7.21.5 to 7.22.4 (#2823) 6 hours ago
package.json chore(deps-dev): Bump @babel/preset-env from 7.21.5 to 7.22.4 (#2823) 6 hours ago
rollup.config.js fix: add version to build files 5 months ago
vercel.json Use cleanUrls 3 years ago

README.md

Marked

npm gzip size 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
npm install @types/marked # For TypeScript projects

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>

License

Copyright (c) 2011-2022, Christopher Jeffrey. (MIT License)