wdpr
    Preparing search index...

    Module parser/rules/inline/expr

    Parses Wikidot's inline expression and conditional block syntax:

    • [[#expr expression]] -- evaluate a mathematical expression and display the result
    • [[#if value | then | else]] -- simple truthy/falsy conditional
    • [[#ifexpr expression | then | else]] -- expression-based conditional

    All three forms begin with [[# followed by the keyword. The # prefix distinguishes these from regular [[block]] syntax.

    [[#if]] treats its condition as a string and considers these values falsy: "false", "null", "", "0". Everything else is truthy.

    [[#ifexpr]] evaluates its condition as a mathematical expression and treats the numeric result as falsy when zero.

    Both conditional forms support an optional else branch: when only one pipe-separated branch is provided, the else branch is empty.

    Expressions are limited to 256 characters (after trimming) to prevent abuse.

    The pipe (|) delimiter is depth-aware: pipes inside nested [[]] or [[[]]] blocks are not treated as branch separators.

    Variables

    exprRule
    ifExprRule
    ifRule