cmark
CommonMark Markdown parser and renderer
TLDR
Convert Markdown to HTML
SYNOPSIS
cmark [options] [file...]
DESCRIPTION
cmark is the reference C implementation of CommonMark, a strongly specified and highly compatible variant of Markdown. It parses Markdown input and converts it to various output formats including HTML, XML, groff man pages, CommonMark, and LaTeX.
The parser is designed for correctness and performance, strictly following the CommonMark specification to eliminate the ambiguities present in the original Markdown description. This makes it suitable for applications that require predictable, consistent rendering across different tools.
cmark reads from files or standard input and writes to standard output, making it easy to integrate into pipelines. The --smart option provides typographic enhancements like curly quotes and em-dashes, while --safe strips potentially dangerous raw HTML from input.
PARAMETERS
--to format
Output format: html, xml, man, commonmark, latex.--smart
Enable smart punctuation (curly quotes, dashes).--safe
Omit raw HTML and potentially unsafe links.--validate-utf8
Validate UTF-8 and replace invalid sequences.--hardbreaks
Render soft breaks as hard breaks.
