ironmark
Fast Markdown-to-HTML parser written in Rust. Fully compliant with CommonMark 0.31.2 (652/652 spec tests pass). Available as a Rust crate and as an npm package via WebAssembly.
Features
- Zero third-party parsing dependencies
- Headings (
#through######) and setext headings - Paragraphs, emphasis, strong emphasis, inline code
strikethrough, ==highlight==, ++underline++- Links, reference links, autolinks (angle-bracket and bare URL/email), images
- Ordered and unordered lists with nesting, task lists (checkboxes)
- Blockquotes, horizontal rules
- Fenced and indented code blocks
- Tables with alignment
- Raw HTML passthrough
- Backslash escapes and HTML entities
JavaScript / TypeScript
Install
Usage
import { parse } from "ironmark";
const html = parse("# Hello\n\nThis is **fast**.");
const bytes = new TextEncoder().encode("# Hello from bytes");
const html2 = parse(bytes);
Options
import { parse } from "ironmark";
const html = parse("line one\nline two", {
hardBreaks: false, // every newline becomes <br /> (default: true)
enableHighlight: true, // ==highlight== → <mark> (default: true)
enableStrikethrough: true, // ~~strike~~ → <del> (default: true)
enableUnderline: true, // ++underline++ → <u> (default: true)
enableTables: true, // pipe tables (default: true)
enableAutolink: true, // bare URLs & emails → <a> (default: true)
enableTaskLists: true, // - [ ] / - [x] checkboxes (default: true)
});
Build from source
| Command | Description |
|---|---|
npm run setup:wasm |
Install prerequisites |
npm run build |
Release WASM build |
npm run build:dev |
Debug WASM build |
npm run test |
Run Rust tests |
npm run check |
Format check + tests |
npm run clean |
Remove build artifacts |
Rust
Add to your project
Usage
use ;
With options
use ;
Benchmarks
Troubleshooting
wasm32-unknown-unknown target not found with Homebrew Rust
The build scripts prepend $HOME/.cargo/bin to PATH so that rustup-managed binaries take priority. If the error persists:
wasm-bindgen not found