pegmd

Parses a non-standard Markdown flavor to an abstract syntax tree by defining its parsing expression grammar (PEG) with pest.

Usage

The main function exported from the crate, parse_document, accepts a &str and on success returns a Document with the same lifetime as the input. From there, you can traverse the tree starting at the root using its iter() or into_iter() methods, which provide a stream of Blocks. Inline styles are defined by the Text enum and represent the leaf nodes of the tree.

Unsupported

Markdown flavor notes

The parser's grammar deviates from CommonMark v0.30 in the following ways:

As an example, this file's syntax follows the rules implemented by the parser.