wdpr
    Preparing search index...

    Module parser/preprocess/whitespace

    Whitespace normalization preprocessing for Wikidot markup.

    This module ensures the lexer and parser receive input with consistent whitespace conventions. It handles platform differences (DOS/Mac newlines), normalizes exotic whitespace characters that users may paste from external sources, and applies Wikidot-specific behaviors like backslash line continuation.

    Substitutions are applied in a deliberate order:

    1. Newline normalization (DOS \r\n and legacy Mac \r to Unix \n)
    2. Non-standard leading whitespace replacement (nbsp, figure space to regular space)
    3. Whitespace-only line stripping (collapse to empty lines)
    4. Backslash line continuation (\\\n to line-break marker U+E000)
    5. Tab expansion (tab to four spaces)
    6. Null character replacement (NUL to space)
    7. Leading/trailing newline removal

    Functions

    substitute