Home

cmark

cmark is the reference implementation of the CommonMark specification, written in the C programming language. It provides a Markdown parser that reads text, constructs an abstract syntax tree (AST), and can render the document to HTML. The library is designed to be small, portable, and straightforward to integrate into other software.

The API exposes a C interface for parsing Markdown into an AST and for rendering that AST

cmark is open-source and released under the BSD 3-Clause license. It was authored by John MacFarlane and

Ecosystem and usage: as the standard reference implementation, cmark is widely used as a building block in

to
HTML.
It
includes
utilities
for
traversing
and
inspecting
the
tree
and
a
small
command-line
tool
that
converts
Markdown
input
to
HTML,
useful
for
testing
and
scripting.
is
maintained
by
the
CommonMark
community.
The
project
emphasizes
faithful
adherence
to
the
CommonMark
specification
and
provides
a
reliable
baseline
for
compatibility
testing.
software
requiring
a
standards-compliant
Markdown
parser.
A
related
project,
cmark-gfm,
extends
the
core
with
GitHub
Flavored
Markdown
features.
The
core
library
is
portable
and
has
bindings
and
ports
to
multiple
languages
for
broader
adoption.