I’ve released a CommonMark parser written in pure, safe, Rust. The code is on github at https://github.com/google/pulldown-cmark, and it’s also the “pulldown-cmark” crate on Cargo.

I’d like for this to become the engine in rustdoc. Right now it implements CommonMark (an effort to standardize Markdown) with no extensions, but if extensions are necessary I’m open to adding them.

Performance should be quite good. In my tests, it’s a little slower than hoedown, and a little faster than the cmark reference implementation written in C. I’m not going to post detailed benchmarks now because there’s probably a little more optimization to be done and I want to make sure my benchmark methodology is sound.

It was fun writing this. I felt the pull parser architecture meshed well with Rust’s iterators, and overall made it easy to write in a style that does very little allocation and copying.

I hope you find it useful! Feedback is welcome.