@motioneffector/markdown
A lightweight, standards-compliant markdown parser for rendering user content safely.

Features
- CommonMark Compliant - Full support for the CommonMark specification
- GitHub Flavored Markdown - Tables, strikethrough, task lists, and autolinks
- XSS Protection - Automatic sanitization of dangerous HTML elements
- Flexible HTML Stripping - Four presets for converting HTML to text
- Zero Dependencies - No supply chain risk or bloated bundles
- Tree-Shakeable ESM - Import only what you need
Read the full manual →
Quick Start
import { markdown, markdownStrip } from '@motioneffector/markdown'
// Convert markdown to HTML
const html = markdown('# Hello **world**!')
// => '<h1>Hello <strong>world</strong>!</h1>'
// Strip HTML to plain text
const plain = markdownStrip(html, 'plaintext')
// => 'Hello world!'
// GitHub Flavored Markdown table
const table = markdown(`
| Feature | Status |
|---------|--------|
| Tables | ✓ |
`)
Testing & Validation
- Comprehensive test suite - 255 unit tests covering core functionality
- Fuzz tested - Randomized input testing to catch edge cases
- Strict TypeScript - Full type coverage with no
any types
- Zero dependencies - No supply chain risk
License
MIT © motioneffector