wdpr
    Preparing search index...

    Module parser/rules/block/module/include/resolve

    Text-level expansion of [[include]] directives.

    Unlike most Wikidot constructs that are handled during AST parsing, include directives are resolved as a text-level macro expansion BEFORE the main parse. This is necessary because included content may contain partial block structures (e.g., an opening [[div]] tag in one include and its closing [[/div]] in another) that must be visible to the parser as a single continuous text.

    The resolution process:

    1. Scan the source text for [[include page | var=val]] patterns
    2. Fetch the included page's content via the provided fetcher callback
    3. Apply variable substitutions ({$key} -> value)
    4. Recursively resolve includes in the fetched content (up to max depth)
    5. Replace the original [[include ...]] directive with the expanded text

    Safety features include circular dependency detection (using a trace of visited pages) and a configurable maximum recursion depth (default: 5).

    Interfaces

    ResolveIncludesOptions

    Type Aliases

    IncludeFetcher

    Functions

    resolveIncludes