A fast, safe, and versatile pull parser for CommonMark and GitHub Flavored Markdown, written in Rust.
pulldown-cmark is a CommonMark parser implemented in Rust, designed for high performance and correctness. It uses a pull parsing architecture that processes Markdown as an iterator of events, minimizing memory allocation while providing a flexible interface for streaming and transformation. It includes a command-line tool for rendering to HTML and is built as a library for integration into Rust applications.
Rust developers who need to parse, transform, or render Markdown documents efficiently, such as those building static site generators, documentation tools, or text processing pipelines. It is also suitable for projects requiring strict CommonMark compliance or advanced features like source maps and GitHub Flavored Markdown extensions.
Developers choose pulldown-cmark for its pull parser architecture, which offers high performance with minimal copying, idiomatic Rust iterator-based API for easy manipulation, and strong compliance with the CommonMark specification. Its optional SIMD acceleration and support for extensions like tables and footnotes provide versatility without sacrificing correctness.
An efficient, reliable parser for CommonMark, a standard dialect of Markdown
Optimized for speed with minimal copying and optional SIMD acceleration for x64 platforms, as highlighted in the build options for release configurations.
Aims for 100% compliance with the CommonMark specification, ensuring reliable and standardized parsing behavior across different Markdown documents.
Uses an idiomatic Rust iterator interface, allowing easy transformations like mapping events, such as converting soft breaks to hard breaks with simple match statements.
Pull parser architecture processes Markdown as a stream of events, minimizing memory allocation and enabling efficient handling of large files without full document trees.
The parser emits events rather than constructing a full abstract syntax tree, which complicates tasks requiring tree-based analysis or complex multi-pass transformations.
Enabling advanced features like SIMD or no_std support requires careful management of feature flags and build options, adding overhead to setup and integration.
The HTML renderer performs many small writes, so using unbuffered targets like direct file output can severely degrade performance, necessitating BufWriter wrappers as warned in the README.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.