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.
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.