These are intended to double as conformance tests.
Parsing has two phases:
This section describes the different kinds of leaf block that make up a Markdown document.
The following rules define [block quotes]:
A [list](@) is a sequence of one or more
list items [of the same type].
Any ASCII punctuation character may be backslash-escaped:
A [code span](@) begins with a backtick string and ends with
a backtick string of equal length.
The following rules define emphasis and strong emphasis:
There are two basic kinds of links in Markdown.
Text between `<` and `>` that looks like an HTML tag is parsed as
a raw HTML tag and will be rendered in HTML without escaping.
HTML is capable of representing the structural distinctions we need to make, and the
choice of HTML for the tests makes it possible to run the tests against an
implementation without writing an abstract syntax tree renderer.
Note that not every feature of the HTML samples is mandated by
the spec.
For example, the spec says what counts as a link destination, but it doesn't mandate that non-ASCII characters in the URL be percent-encoded.