Module documentation for 0.1.6

cmark-gfm-hs

This package provides Haskell bindings for libcmark-gfm, the reference
parser for GitHub Flavored Markdown, a fully specified variant of Markdown.
It includes sources for libcmark-gfm and does not require prior
installation of the C library.

cmark provides the following advantages over existing Markdown
libraries for Haskell:

Speed: cmark can render a Markdown version of War and Peace in
the blink of an eye. Conversion speed is on par with the
sundown library, though we were unable to benchmark precisely,
because sundown raised a malloc error when compiled into our
benchmark suite. Relative to other Haskell Markdown libraries:
cmark was 82 times faster than cheapskate, 59 times faster than
markdown, 105 times faster than pandoc, and 3 times faster
than discount.

Memory footprint: Memory footprint is on par with sundown.
On one sample, the library uses a fourth the memory that markdown
uses, and less than a tenth the memory that pandoc uses.

Robustness: cmark can handle whatever is thrown at it,
without the exponential blowups in parsing time that sometimes afflict
other libraries. (The input bench/full-sample.md,
for example, causes both pandoc and markdown to grind to a
halt.) libcmark-gfm has been extensively fuzz-tested.

Standardization: Since there is a spec and a comprehensive suite
of tests, we can have a high degree of confidence that any two
CommonMark implementations will behave the same. Thus, for
example, one could use this library for server-side rendering
and commonmark.js for client-side previewing.

Multiple renderers. Output in HTML, groff man, LaTeX, CommonMark,
and a custom XML format is supported. And it is easy to write new
renderers to support other formats.

Ease of installation: cmark is portable and has minimal
dependencies.

cmark does not provide Haskell versions of the whole libcmark-gfm
API, which is built around mutable cmark_node objects. Instead, it
provides functions for converting CommonMark to HTML (and other
formats), and a function for converting CommonMark to a Node
tree that can be processed further using Haskell.

A note on security: This library does not attempt to sanitize
HTML output. We recommend using xss-sanitize to filter the output,
or enabling optSafe to filter out all raw HTML and potentially
dangerous URLs.

A note on stability: There is a good chance the API will change
significantly after this early release.

Changes

cmark-gfm 0.1.8 (14 Mar 2019)

* Pull in upstream changes.

cmark 0.5.6.3 (13 Mar 2019)

* Use snoc instead of <> to add the null terminator.

cmark 0.5.6.2 (13 Mar 2019)

* Ensure that withtext adds a null terminator (#14). This fixes a regression due to PR #13, which caused random content to appear in rendered TEXT nodes.

* Fix use-after-free bugs (Anders Kaseorg). `useAsCString` frees the CString after the IO action finishes executing, so passing `return` as that action can never be correct. To make sure the CString gets freed at the right time, we need a “with”-style abstraction, not just a conversion function. While we’re here replace this with `withCStringLen`, which also makes fewer copies.

* Show node type on error for unknown node type.

cmark-gfm 0.1.6 (17 Oct 2018)

* Update to cmark-gfm 0.28.3.gfm.18. * `optUnsafe` is now exposed, instead of `optSafe`.