📄 README.md

← 返回目录

Marked

![npm](https://www.npmjs.com/package/marked) ![install size](https://packagephobia.now.sh/result?p=marked) ![downloads](https://www.npmjs.com/package/marked) ![github actions](https://github.com/markedjs/marked/actions) ![snyk](https://snyk.io/test/npm/marked)

- ⚡ built for speed

* Extensibility

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

CLI

`` bash

Example with stdin input

$ marked -o hello.html hello world ^D $ cat hello.html

hello world


bash

Print all options

$ marked --help

Browser

html Marked in the browser
or import esm module

html
``

License

Copyright (c) 2018+, MarkedJS. (MIT License) Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License)