Skip to content

Migrate from markdown-it

Migration Guide

markdown-exit is designed to be a drop-in replacement for markdown-it with several enhancements.

After installing markdown-exit, simply update your imports and everything should work as expected.

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

Named Import

markdown-it uses default imports by default. While markdown-exit is compatible with this approach, it’s recommended to use named import instead, as they are more tree-shaking friendly.

ts
import { createMarkdownExit } from 'markdown-exit'

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

// with the `new` keyword
const md = new MarkdownExit()

Plugin Compatibility

Most markdown-it plugins should work seamlessly with markdown-exit.

ts
import { full as emoji } from 'markdown-it-emoji'

md.use(emoji)

If a plugin is incompatible, please submit an issue or follow the Plugin Guide to add markdown-exit support.

Released under the MIT License.