comark-parser-0.1.0: Parser for Commonmark (markdown)

Safe HaskellSafe
LanguageHaskell2010

Comark.Parser

Synopsis

Documentation

parse :: [ParserOption] -> Text -> Doc Text Source #

Parses Commonmark document. Any sequence of characters is a valid Commonmark document.

At the moment no sanitizations are performed besides the ones defined in the spec.

data ParserOption Source #

Constructors

Normalize

Consolidate adjacent text nodes.

LinkReferences (Text -> Maybe (Text, Maybe Text))

Predefine link reference defenitions.

References are represented with a mapping from a link text to a pair of a link destination and an optional link title.

During parsing the link references defined in a document would be collected into additional mapping. When link references are being mapping defined in options takes precedence over mapping found in the document.

TODO: Examples