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 install markdown-it
yarn add markdown-it
pnpm add markdown-it
Import
import MarkdownIt from 'markdown-it';
Quick Example
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
| Package | markdown-it |
| Category | Utility |
| Weekly Downloads | 5M+ |
| License | MIT |
| Install | npm install markdown-it |
Related Packages
Marked is a fast, low-level Markdown parser and compiler built for speed, providing a simple API for…
gray-matter is a library for parsing front-matter from strings or files, extracting the metadata sec…
Cheerio is a fast, flexible, and lean implementation of jQuery designed specifically for server-side…
Browse npm Packages by Category
Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.