MCPcopy Create free account
hub / github.com/markedjs/marked

github.com/markedjs/marked

Chat with this repo
repository ↗ · DeepWiki ↗ · release v18.0.10 ↗ · + Follow · compare 7 versions
281 symbols 659 edges 53 files ⚖ MIT 23 documented · 8% updated 5d agov18.0.11 · 2026-08-24★ 37,0988 open issues

Browse by type

Functions 231 Types & classes 50
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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

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="https://github.com/markedjs/marked/raw/v18.0.10/x" onerror="alert('not happening')">`));

CLI

# Example with stdin input
$ marked -o hello.html
hello world
^D
$ cat hello.html


hello world


# 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>





  <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)

Extension points exported contracts — how you extend this code

browse all types & interfaces →

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 146
Method 85
Interface 34
Class 16

Languages

TypeScript100%

Modules by API surface

docs/demo/demo.js35 symbols
src/Tokenizer.ts29 symbols
src/Tokens.ts25 symbols
src/Renderer.ts25 symbols
test/types/marked.ts16 symbols
docs/js/index.js14 symbols
test/unit/marked.test.js13 symbols
src/TextRenderer.ts12 symbols
src/Instance.ts11 symbols
bin/main.js11 symbols
src/Lexer.ts10 symbols
src/Hooks.ts9 symbols

Dependencies from manifests, versioned

@arethetypeswrong/cli0.18.5 · 1×
@markedjs/eslint-config1.0.14 · 1×
@markedjs/testutils18.0.0-1 · 1×
@semantic-release/commit-analyzer13.0.1 · 1×
@semantic-release/git11.0.1 · 1×
@semantic-release/github12.0.9 · 1×
@semantic-release/npm13.1.5 · 1×
@semantic-release/release-notes-generator14.1.1 · 1×
cheerio1.2.0 · 1×
commonmark0.31.2 · 1×
cross-env10.1.0 · 1×

For agents

$ claude mcp add marked \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page