Skip to content

Fast, customizable Markdown parser and renderer with full CommonMark support. TypeScript rewrite of markdown-it with enhancements.

License

Notifications You must be signed in to change notification settings

serkodev/markdown-exit

Repository files navigation

markdown-exit banner

markdown-exit

npm version bundle License Ask DeepWiki

A TypeScript rewrite of markdown-it with first-class typings, modern tooling, and enhancements.

Compatibility & Differences

  • API compatibility: Compatible with markdown-it v14.1.0 and plugin API.
  • TypeScript: Ship robust types, improve DX, and enable type-safe development.
  • Extensibility: Provide a clean foundation for new features that are easier to prototype and maintain.
  • New features: Track via features for details.

Quickstart

Install

v1+ (latest): All new features and may include breaking changes.

Important

🚧 markdown-exit v1 is currently in public beta (v1.0.0-beta.*).
Breaking changes may occur until a stable v1.0.0 is released.

npm i markdown-exit

v0.x (legacy): Full compatibility with markdown-it usage while adding TypeScript support, bug fixes and performance improvements. (v0 branch)

npm i markdown-exit@legacy

Usage

Named import (recommended)

import { createMarkdownExit } from 'markdown-exit'

// factory helper
const md = createMarkdownExit()
md.render('# markdown-exit')
import { MarkdownExit } from 'markdown-exit'

// with the `new` keyword
const md = new MarkdownExit()
md.render('# markdown-exit')

Default import

Note

Default export (with callable constructor support) is retained for markdown-it compatibility, but it may have drawbacks in module interop and tree-shaking.

Example
import MarkdownExit from 'markdown-exit'

// callable function
const md = MarkdownExit()
md.render('# markdown-exit')
// with the `new` keyword
const md = new MarkdownExit()
md.render('# markdown-exit')

Documentation

Visit markdown-it API Documentation for more info and examples.

Migrate from markdown-it

markdown-exit is designed to be a drop-in replacement for markdown-it with enhancements. After installing markdown-exit, simply update your imports:

- import MarkdownIt from 'markdown-it'
+ import MarkdownExit from 'markdown-exit'

Everything else should work as expected. ✨

References / Thanks

This project owes its foundation to the markdown-it community and all its contributors.

Authors of markdown-it

Special Thanks

License

MIT License © Alex Kocharin, Vitaly Puzrin, SerKo

About

Fast, customizable Markdown parser and renderer with full CommonMark support. TypeScript rewrite of markdown-it with enhancements.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published