Mausmark
A fast Markdown parser without baggage.
I needed a Markdown parser for a couple of personal projects. But just as with a CMS for your own website, I kept getting stuck because something was lacking. I didn’t want to learn and install specific versions of some build system. I didn’t want to use weird syntax or extensions to implement custom things. What I did want was to learn modern C practices.
I present to you Mausmark. A Markdown parser that’s easy to add to your project and easy to change. This means that if you don’t like its rendering, you can intervene and make it your own. You can convert to an HTML string that goes in a file, or build a DOM tree directly in the browser. The parser doesn’t dictate the output.
It’s plenty fast. A typical article goes from Markdown to a document tree in about 3 µs, and on to HTML in about 4 µs. A 1.2 MB book takes ~0.23 ms to the tree, ~0.33 ms to HTML — measured on an M3 Pro. The wasm build running on this page does it at roughly 0.6× of native.
It follows the original Markdown rules and most of CommonMark. For instance, it doesn’t treat every punctuation mark as special.
Try it
Edit the Markdown on the left — the HTML renders live on the right.
Put your plain text here:
Get your document here:
Project status
Alpha. The API is not settled, tables are missing, inputs cap at 4 GB. Likely to be open-sourced in the near future.
If you feel adventurous, you can try Mausmark’s alpha release on npm:
npm install mausmark@alpha