Expand description
Line-level tokens the Markdown with Gherkin flavor inherits from Gherkin.
Gherkin is line-oriented: its parser classifies Markdown content one line at a time. MDG embeds three of its recognized shapes in Markdown, where each one collides with a Markdown construct that would otherwise rewrite or delete it:
- a Data Table or Examples row, matched as
/^\s\s\s?\s?\s?\|/, whose indentation overlaps the 4-column indented-code threshold; - a tag line, spelled in MDG as backtick-wrapped
@tagsso Gherkin’s bare@tagsurvives as Markdown, which binds to the structure on the very next line; - a structure heading,
Keyword: name, whose keyword is a dialect term that names a structure only when spelled exactly.
Each rule decides for itself what to do about a token; this module only says what Gherkin sees.
Constants§
- MAX_
TABLE_ INDENT - The widest indentation Gherkin still reads as such a table.
- MIN_
TABLE_ INDENT - The narrowest indentation Gherkin accepts for a Data Table or Examples table, and therefore the canonical width such a table is normalized to.
Functions§
- is_
table_ row - Whether
lineis a row of a Gherkin Data Table or Examples table. - is_
tag_ line - Whether Gherkin finds at least one backtick-wrapped tag on a line.
- keyword_
split - Split a structure heading into its keyword, colon included, and the name
that follows, or
Nonewhen the text names no structure.