wdpr
    Preparing search index...
    • Recursively remove internal flags from AST elements and clean up empty spans.

      During parsing, elements are annotated with internal flags like _paragraphStrip, _emptyParagraphStrip, _escapedFromParagraph, and _splitByBlankLine. These flags serve as inter-pass communication and must be stripped before the AST is returned to callers.

      Additionally, empty [[span]][[/span]] elements and their adjacent whitespace text nodes are removed. Wikidot renders empty spans as no output, so they and their surrounding whitespace should not appear in the final AST.

      Parameters

      • elements: Element[]

        Array of elements to clean

      Returns Element[]

      New array with all internal flags removed and empty spans stripped