Introducing markdown-exit: The TypeScript-Powered Markdown Engine for Vue Docs
The Vue team’s new markdown-exit library rewrites markdown-it in TypeScript, adding async plugin support, built‑in type definitions, and modern build integration, enabling seamless Markdown rendering for VitePress, Slidev, and regular Vue projects with zero‑migration effort.
Vue team member introduces markdown-exit, a TypeScript‑rewritten version of markdown‑it.
markdown-it is the engine that converts Markdown to HTML, but its 2014 JavaScript design lacks async plugins and built‑in type definitions. Anthony Fu wished for async support for VitePress and Slidev.
“I’ve been looking for this forever! The lack of async plugins limits us, I hope VitePress, Slidev can use it.”
SerKo released markdown-exit, which converts Markdown to HTML with a TypeScript core and supports async plugins, native type definitions, and modern build tools (Vite, Vitest, pnpm monorepo).
What does it do?
Converts Markdown to HTML with a “TypeScript heart”.
Feature comparison:
HTML output: markdown-it ✅, markdown-exit ✅ (100% compatible)
Synchronous plugins: both ✅
Async plugins: markdown-it ❌, markdown-exit ✅ (official support)
Type definitions: community @types vs built‑in
Modern build: none vs Vite + Vitest + pnpm monorepo
Code highlighting: plugin vs async one‑line highlight
Implications for the Vue ecosystem
VitePress : can fetch async code or remote snippets at compile time.
Slidev : can embed GitHub files, CodePen, CodeSandbox directly.
Regular Vue projects : no need to import @types/markdown-it for SSR or edge functions.
Get started in two minutes
# Latest feature version (public beta)
npm i markdown-exit
# Stable compatible version
npm i markdown-exit@legacy // Named import, tree‑shaking friendly
import { createMarkdownExit } from 'markdown-exit';
const md = createMarkdownExit();
console.log(md.render('# Hello markdown-exit'));Async highlighting example:
md.use(asyncPlugin, async (code, lang) => {
const html = await fetchHighlighter(lang) // any async operation
return html
})Zero‑cost migration
Replace the import in existing projects:
- import MarkdownIt from 'markdown-it'
+ import MarkdownExit from 'markdown-exit'All plugins, configuration, and rendering results work without further changes.
Timeline & roadmap
Now : v1.0.0‑beta public beta, features complete, API locked.
Future (1‑2 months) : release stable v1.0.0; official templates for VitePress and Slidev switch.
Long term : explore AST‑level caching, WebAssembly acceleration, streaming rendering.
Conclusion
From vue/core to vite and now markdown‑exit, the Vue team keeps refining the underlying infrastructure to make higher‑level development smoother. When you need Markdown in a Vue project, try the new “heart” with npm i markdown-exit and say goodbye to type errors and async limitations.
GitHub:
https://github.com/serkodev/markdown-exitHow this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
