@wdprlib/ast
    Preparing search index...

    Interface WikitextSettings

    Controls which parser and renderer features are active.

    These flags gate syntax availability and rendering behaviour based on the context where the wikitext appears. Construct via createSettings and override individual fields when non-default behaviour is needed.

    interface WikitextSettings {
        allowHtmlBlocks: boolean;
        allowLocalPaths: boolean;
        allowStyleElements: boolean;
        enablePageSyntax: boolean;
        mode: WikitextMode;
        useTrueIds: boolean;
    }
    Index

    Properties

    allowHtmlBlocks: boolean

    Whether [[html]] blocks are recognised by the parser and rendered.

    HTML blocks embed raw HTML that the renderer serves inside a sandboxed iframe. The capability is meaningful only in contexts that can host the auxiliary iframe URL, so it is disabled in drafts, forum posts, and direct messages.

    When false, the parser still consumes the entire [[html]]...[[/html]] span (so the raw body cannot leak as text) but emits no AST node, and the renderer skips any pre-existing html element it encounters.

    Wikidot's legacy Text_Wiki keeps Html in its $disable list by default (lib/Text_Wiki/Text/Wiki.php line 145-147), so an authentic Wikidot-compat default would be false even in "page" mode. wp keeps "page" at true for now to preserve existing consumers; a future change may align with Wikidot.

    allowLocalPaths: boolean

    Whether local file references (file1, file2, file3) are allowed in image sources.

    Local files belong to a specific wiki page. In contexts that lack a "current page" — such as forum posts and direct messages — local file references are meaningless and should be rejected.

    allowStyleElements: boolean

    Whether [[module CSS]] blocks are rendered as <style> tags.

    User-authored CSS can break page layout, so it is allowed only on full wiki pages. In draft previews, forum posts, and direct messages the CSS module is silently ignored.

    enablePageSyntax: boolean

    Whether page-contextual syntax is permitted.

    When true, the parser recognises [[include]], [[module]], and [[toc]] blocks. These constructs are meaningful only inside a full wiki page and are disabled in forum posts and direct messages.

    The context mode this settings object was created for

    useTrueIds: boolean

    Whether heading and footnote IDs use stable sequential values (toc0, toc1, ...) or randomised strings.

    Stable IDs are appropriate when a single rendered page owns the full document. Randomised IDs prevent collisions when multiple rendered fragments (e.g. a live draft preview) coexist on the same HTML page.