wdpr
    Preparing search index...

    Block rule interface

    interface BlockRule {
        name: string;
        preservesPrecedingLineBreak?: boolean;
        requiresLineStart: boolean;
        startTokens: TokenType[];
        isStartPattern?(ctx: ParseContext, pos: number): boolean;
        parse(ctx: ParseContext): RuleResult<Element>;
    }
    Index

    Properties

    name: string

    Rule name for debugging

    preservesPrecedingLineBreak?: boolean

    When true, a single newline before this block becomes a line-break. Wikidot's Divalign expands content inline, so \n before nested blocks becomes
    . Other blocks (Code, Div, etc.) suppress this.

    requiresLineStart: boolean

    Whether this rule requires line start

    startTokens: TokenType[]

    Token types that can start this rule

    Methods

    • Check if tokens at the given position match this rule's start pattern. Used by inline parser to determine behavior before a block boundary (e.g. whether to generate a trailing line-break).

      Parameters

      Returns boolean