thematicBreak method
Horizontal rule / thematic break (---, ***, ___).
Implementation
Parser<ThematicBreakNode> thematicBreak() =>
seq6(
position(),
ref0(nonIndentSpace),
[
seq3(
char('*'),
ref0(sp),
char('*'),
).then(seq2(ref0(sp), char('*')).repeat(1, 100)),
seq3(
char('-'),
ref0(sp),
char('-'),
).then(seq2(ref0(sp), char('-')).repeat(1, 100)),
seq3(
char('_'),
ref0(sp),
char('_'),
).then(seq2(ref0(sp), char('_')).repeat(1, 100)),
].toChoiceParser(),
ref0(sp),
[ref0(newlineSequence), endOfInput()].toChoiceParser(),
position(),
).map6(
(start, _, _, _, _, stop) =>
ThematicBreakNode(start: start, stop: stop),
);