@wdprlib/parser
    Preparing search index...

    Interface Diagnostic

    A single diagnostic emitted during parsing.

    Each diagnostic pinpoints a source location via Position and carries a machine-readable code string for programmatic filtering (e.g. "unclosed-block", "inline-block-element").

    import { parse } from "@wdprlib/parser";

    const { ast, diagnostics } = parse("[[div]]\nHello");
    for (const d of diagnostics) {
    console.log(`[${d.severity}] ${d.message} (line ${d.position.start.line})`);
    }

    2.0.0

    interface Diagnostic {
        code: string;
        message: string;
        position: Position;
        relatedPosition?: Position;
        severity: DiagnosticSeverity;
    }
    Index

    Properties

    code: string

    Machine-readable identifier for the diagnostic kind.

    Current codes:

    • "unclosed-block" — a block element has no matching close tag.
    • "inline-block-element" — a block element (e.g. [[div]]) is used inline without the required trailing newline.
    message: string

    Human-readable description of the issue.

    position: Position

    Source range where the issue was detected.

    relatedPosition?: Position

    An optional related source range that provides additional context (e.g. the opening tag position when reporting a missing close tag).

    How severe the issue is.