Central registry for all block-level parser rules.
This module imports every block rule, re-exports each one individually
(for selective use), and assembles them into the ordered blockRules
array that the main parser iterates through.
Rule ordering matters: rules earlier in the array are tried first.
Line-start-only rules (comments, headings, lists, etc.) are naturally
filtered by the requiresLineStart flag, but among rules that share
a start token (e.g. BLOCK_OPEN), position in this array determines
priority. For example, codeBlockRule is tried before collapsibleRule
because both start with BLOCK_OPEN but code blocks should be matched
first.
The paragraph rule is deliberately excluded from the array -- it serves
as a fallback and is exported separately as blockFallbackRule.
Central registry for all block-level parser rules.
This module imports every block rule, re-exports each one individually (for selective use), and assembles them into the ordered
blockRulesarray that the main parser iterates through.Rule ordering matters: rules earlier in the array are tried first. Line-start-only rules (comments, headings, lists, etc.) are naturally filtered by the
requiresLineStartflag, but among rules that share a start token (e.g. BLOCK_OPEN), position in this array determines priority. For example,codeBlockRuleis tried beforecollapsibleRulebecause both start with BLOCK_OPEN but code blocks should be matched first.The paragraph rule is deliberately excluded from the array -- it serves as a fallback and is exported separately as
blockFallbackRule.