Expand description
Lexical predicates: grammar facts for formatters.
A markdown formatter constantly synthesizes new line starts
(joining lines for prose wrap, stripping indent, removing escapes).
Whether the synthesized line would open a block is a grammar fact,
and approximating it downstream is the classic printer failure mode
(Prettier’s /^>|^(?:[*+-]|#{1,6}|\d+[).])$/ misses :::, fences, <, and |.
Each a documented meaning-breaking bug).
This module exposes the parser’s own classification instead:
line_start runs the exact probe table the block engine uses, so the two cannot drift.
Policy-free: these functions state what the grammar would do with a line, never what a formatter should do about it.
Enums§
- Line
Start - What a line would open at flow position. One variant per block construct; the payload-free mirror of the engine’s probe result.
Functions§
- line_
start - Classifies what
line(one line, no line ending) would start as a block, orNonefor paragraph text.in_paragraphenables the constructs that only exist relative to an open paragraph. - ordered_
number - The number of an ordered list marker (
123./123)), for a printer that renumbers. CommonMark caps markers at 9 digits, so the value always fits;Nonefor a bullet. - table_
delimiter_ activates - Whether delimiter row
rowopens a table underheader, the paragraph line right above it.