pulldown-cmark

A fast, safe pull parser for CommonMark Markdown written in pure Rust

Library
Cargo
v0.13.4
2,682stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
84/100Excellent
Development Activity96
Maintenance72
Community68
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
85/100Excellent
Architecture90
Code Quality88
Innovation85
Learning Curve78

pulldown-cmark is a pull-based CommonMark parser for Rust that turns Markdown source into an iterator of events rather than a fully materialized document tree. That design keeps memory allocation to a minimum, since most text is emitted as zero-copy slices of the original source, and it lets callers transform or filter the parse stream with ordinary iterator combinators like map and filter. It targets 100% compliance with the CommonMark spec while optionally supporting GitHub-flavored extensions such as tables, task lists, footnotes, and strikethrough.

What You Get

  • A pull-style Parser implementing Rust’s Iterator trait over Event values for start/end tags, text, breaks, and inline content
  • A built-in HTML renderer (html::push_html) for converting the event stream directly into an HTML string buffer
  • Optional CommonMark extensions: tables, task lists, footnotes, strikethrough, smart punctuation, and ==highlight== marks
  • Source-map support via into_offset_iter(), yielding (Event, Range) pairs that map each event back to its byte offset in the source
  • A no_std-compatible build (via --no-default-features plus hashbrown) for use in constrained environments
  • A bundled CLI binary for quick Markdown-to-HTML rendering from the command line

Common Use Cases

  • Rendering Markdown documentation, README files, or CMS content to HTML at build time or request time
  • Building custom Markdown transformations (e.g. soft-break-to-hard-break conversion, link rewriting) by mapping over the event iterator
  • Powering static site generators and documentation tools (it is the parser behind mdBook and other Rust doc tooling) where source-map fidelity and performance matter
  • Extracting structured data from Markdown (headings, links, code blocks) by consuming the event stream without building a full AST

Under The Hood

Architecture — The parser runs a first pass (firstpass.rs) that scans the source for block-level structure and builds a tree of block spans (tree.rs), followed by an inline pass (parse.rs) that resolves emphasis, links, and other span-level constructs against that tree; lib.rs exposes the resulting Parser as a Rust Iterator<Item = Event>, and html.rs is a separate consumer that walks the same event stream to emit HTML, keeping parsing and rendering strictly decoupled. Tech Stack — Pure Rust (98.5% of the codebase) with zero required dependencies for the core parser; entities.rs and puncttable.rs are large generated lookup tables for HTML entity decoding and Unicode punctuation classification, and an optional simd feature enables SIMD-accelerated scanning on x86-64. Code Quality — The workspace includes a dedicated tests/ directory plus specs/ containing the CommonMark spec test suite, a fuzz/ and dos-fuzzer/ crate for fuzz-testing parser robustness (guarding against pathological/adversarial input), and CI-run bench/ benchmarks; the crate compiles under #![no_std]-friendly configurations, evidence of disciplined dependency and API-surface hygiene. API Design — The Iterator-based Event API is idiomatic Rust, requires only 3-4 lines to go from Markdown string to HTML output, and cleanly separates parsing from rendering so consumers can filter, map, or collect the event stream before it ever touches HTML — a deliberate improvement over push-parser designs common in other Markdown libraries.

Used by 5 apps in this directory

TypeScript
51%
MIT

Anarlog

Note Taking · AI Assistants · Productivity

9,087

Anarlog is an open-source, local-first AI meeting notetaker that records, transcribes, and summarizes meetings entirely on your device — no cloud lock-in, no mandatory account, and every note saved as a plain markdown file you own forever.

View details
86
Repo Health
77
Technical
69
Dependency
Built with
TypeScript51%
Rust38%
Updated today
Rust
95%
MIT

claw-code

AI Agents · AI Code Assistants

195,087

A Rust-built CLI agent harness for Claude AI with persistent sessions, MCP tool integration, plugin hooks, and multi-provider support — designed to run autonomous coding workflows without human babysitting.

View details
71
Repo Health
71
Technical
77
Dependency
Built with
Rust95%
Updated 3 days ago
Rust
52%
Apache 2.0

cocoindex

Data Engineering · AI Development

11,350

An incremental data indexing engine that keeps AI agent context perpetually fresh by reprocessing only what changed.

View details
87
Repo Health
85
Technical
64
Dependency
Built with
Rust52%
Python48%
Updated yesterday
Rust
100%
Other

Fluree DB

Databases

445

A temporal, verifiable graph database with git-like branching, integrated vector/text/geo search, and RDF/SPARQL/JSON-LD/openCypher support — benchmarked at 10.4x faster than the next database on the full Wikidata dump.

View details
86
Repo Health
74
Technical
65
Dependency
Built with
Rust100%
Updated yesterday
Rust
47%
MIT

Kuku

Note Taking

204

A local-first, open-source Markdown knowledge workspace for macOS — plain files, personal wiki and Second Brain workflows, AI-assisted diffs, and encrypted sync, built as an Obsidian alternative.

View details
73
Repo Health
67
Technical
68
Dependency
Built with
Rust47%
TypeScript40%
Updated 1 months ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search