wdpr
    Preparing search index...
    • 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.

      Parameters

      • ctx: ParseContext

        Parse context positioned at the start of the body.

      • closeCondition: (ctx: ParseContext) => boolean

        Predicate that signals the end of the block body.

      Returns BlockParseResult

      Parsed elements and total tokens consumed.