markz
On this page

upstream

Vendored upstream examples, read-only inputs to the oracle harness, one file per suite in the fence format fences.ts reads. Each file's metadata names the suite's source at its pinned commit and what its examples are checked by: oracle (micromark), yaml, slug or math. Examples keep the suite's own numbers, as commonmark:42. The expected output in them is each suite's own; markz is compared with its oracle, not with it, and the oracle is checked against it where it has any. The files are generated, so the formatter leaves them alone, and examples.test.ts holds each to exactly what fences.ts writes.

  • commonmark.md: CommonMark 0.31.2, as published, converted once to this format.
  • gfm.md: the (extension) sections of cmark-gfm's test/spec.txt (commit 499789b), converted once to the same format. Example numbers are the GFM spec's, → is turned back into a tab, and the section names lose their (extension) suffix.
  • gfm-table.md and gfm-strikethrough.md: the tests of micromark-extension-gfm-table (commit 1511204) and micromark-extension-gfm-strikethrough (commit 895451f), and directive.md, from micromark-extension-directive (commit 75da8c5), and frontmatter.md, from micromark-extension-frontmatter (commit f05bf24), written by test/vendor.ts. Each fixture section is an example, with GitHub's HTML for it, and each micromark(input, …) in test/index.js with a literal input is one, numbered in that order, under its test() group and title. The expected HTML is kept only where the options are written out in place: the directive suite's options(…) helper installs handlers, so its examples have none, and the oracle isn't checked against them. Left out: tests of an option that changes the syntax (disable.null, singleTilde, a TOML or custom matter), the fixture loops, whose input isn't a literal, repeated inputs, and the 80,000-line large.offline.md, which belongs with step 16's stress tests. The directive suite is curated to 156 of its 251: the name, label and attribute rules it repeats for each kind of directive, and each directive next to a block form markz cuts, are in stress/.
  • yaml.md: the yaml-test-suite (commit da267a5), also by vendor.ts. Each test, and each variant, is its YAML between --- fences, with the suite's JSON, or error for a test marked fail. It is kept to what the yaml package reads as a mapping or rejects: top-level sequences and scalars (94) aren't metadata anywhere, and tests with document markers or directives (151) can't sit inside the fences. Of the 159 left, curation keeps valid blocks of plain key: value lines and the first test of each YAML feature (anchors, tags, flow, block scalars, …): 29. The rest are in stress/.
  • slugger.md: github-slugger (commit 3461c43), GitHub's ids for 78 strings, also by vendor.ts. Each is a # heading with its ASCII punctuation escaped, and the harness puts each after the ones before it, so repeats are numbered as in the suite. The four that start or end with a space are left out, since a heading's text is trimmed.
  • gfm-autolink-literal.md: the tests of micromark-extension-gfm-autolink-literal (commit 618170c), by vendor.ts as the other extensions are: 15 fixture sections and 24 inline tests. markz cuts bare URLs, so these test the bare-url warning: one for each URL GFM links, and none elsewhere. Left out: the three disable.null tests, and the fixtures that sweep a character class, which are in stress/.
  • gfm-footnote.md: the tests of micromark-extension-gfm-footnote (commit 0a62fad), by vendor.ts. markz cuts footnotes, so these test the footnote warning: one over each call and definition GFM reads. Curation keeps what markz decides (calls, definitions, [^x] beside links, images and references, ^[x] as text), 20 of 49; the fixtures on a footnote's own content are in stress/. Left out: the disable.null test and the fixture loop.
  • math.md: the tests of micromark-extension-math (commit 4c9e82c), 30 inputs, by vendor.ts. The extension writes KaTeX's HTML, so there is no expected HTML: the harness holds markz to the extension's math spans (display or inline, where each starts, the TeX inside). Left out: the disable.null test and one that turns off indented code.

Folders

  • stress/

    Upstream examples that curation keeps off the Conformance page: sweeps of a character class and variants of a form markz cuts or doesn't read, written by test/vendor.ts next to the curated file in ../, from the same pinned commit. They aren't filed or given a status. stress.test.ts only holds markz to what must hold for any input: it finishes quickly, doesn't throw, builds a valid tree, and warns over every bare URL GFM links and every footnote it reads.

Docs