🛠️
Utility5M+/wkMIT

markdown-it

markdown-it is a fast and extensible Markdown parser that converts Markdown text to HTML with 100% CommonMark support and extensions for syntax highlighting, ta

Installation

npm
npm install markdown-it
yarn
yarn add markdown-it
pnpm
pnpm add markdown-it

Import

ESM
import MarkdownIt from 'markdown-it';

Quick Example

usage
import MarkdownIt from 'markdown-it';

const md = new MarkdownIt({ html: true, linkify: true });
const result = md.render('# Hello **world**');
console.log(result);
// '<h1>Hello <strong>world</strong></h1>'

About markdown-it

markdown-it is a fast and extensible Markdown parser that converts Markdown text to HTML with 100% CommonMark support and extensions for syntax highlighting, tables, strikethrough, and more. The library is designed around a plugin architecture that makes it easy to add new syntax rules, modify parsing behavior, and extend the output format. markdown-it's rule-based architecture separates inline parsing from block parsing, with each rule handling a specific Markdown syntax element. The library includes built-in plugins for tables, strikethrough, and footnotes (through markdown-it-footnote), with a rich ecosystem of community plugins for task lists, table of contents, container blocks, mathematical equations, diagrams, and custom containers. markdown-it supports linkify for automatic URL detection, typographic replacements for smart quotes and dashes, and configurable HTML sanitization. The parser produces an intermediate token stream that can be inspected and transformed before rendering, enabling advanced customizations like custom block rendering and content extraction. markdown-it is the Markdown engine used by many popular tools including GitLab, VuePress, and Docusaurus, chosen for its extensibility and specification compliance.

Quick Facts

Packagemarkdown-it
CategoryUtility
Weekly Downloads5M+
LicenseMIT
Installnpm install markdown-it

Related Packages

Browse npm Packages by Category

Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.