Parses block-level elements from the token stream until a close
condition is satisfied.
This is the workhorse parser used by container blocks (div, collapsible,
tabview, iftags, align, etc.) to parse their body content. It loops
through tokens, trying each block rule in priority order, and falls back
to the paragraph rule when nothing else matches.
Whitespace and newline tokens between blocks are silently consumed.
The close condition receives a ParseContext snapshot at the current
position and should return true to stop parsing (the close tag
itself is NOT consumed here -- the caller handles that).
The close condition is also injected into blockCloseCondition on
the context so that the paragraph parser can respect the enclosing
block's boundary.
Parses block-level elements from the token stream until a close condition is satisfied.
This is the workhorse parser used by container blocks (div, collapsible, tabview, iftags, align, etc.) to parse their body content. It loops through tokens, trying each block rule in priority order, and falls back to the paragraph rule when nothing else matches.
Whitespace and newline tokens between blocks are silently consumed. The close condition receives a ParseContext snapshot at the current position and should return
trueto stop parsing (the close tag itself is NOT consumed here -- the caller handles that).The close condition is also injected into
blockCloseConditionon the context so that the paragraph parser can respect the enclosing block's boundary.