Parses the Wikidot span block syntax: [[span attributes]]content[[/span]]
and its paragraph-strip variant [[span_]].
A span wraps inline content in an HTML <span> element with arbitrary
attributes (class, style, id, etc.). It supports multiline content
where single newlines become <br /> elements.
Blank lines (double newlines) within spans trigger special behavior:
Regular span ([[span]]):
Blank lines split the content into separate spans, each placed in
its own paragraph. Segments after the first are marked with
_splitByBlankLine: true for postprocessing.
Paragraph-strip span ([[span_]]):
Content before a blank line gets _paragraphStrip: true, indicating
it should merge with the surrounding paragraph.
Content after a blank line gets _escapedFromParagraph: true,
indicating it should appear outside any paragraph wrapper.
An empty [[span_]][[/span]] produces a marker with
_emptyParagraphStrip: true that absorbs adjacent line breaks.
Spans support nesting -- a [[span]] inside another [[span]] will
correctly find its own [[/span]] closing tag.
The closeSpanRule handles orphaned [[/span]] tags that result
from paragraph-break splitting. These wrap preceding inline content
into a span, matching Wikidot's behavior.
Parses the Wikidot span block syntax:
[[span attributes]]content[[/span]]and its paragraph-strip variant[[span_]].A span wraps inline content in an HTML
<span>element with arbitrary attributes (class, style, id, etc.). It supports multiline content where single newlines become<br />elements.Blank lines (double newlines) within spans trigger special behavior:
Regular span (
[[span]]):_splitByBlankLine: truefor postprocessing.Paragraph-strip span (
[[span_]]):_paragraphStrip: true, indicating it should merge with the surrounding paragraph._escapedFromParagraph: true, indicating it should appear outside any paragraph wrapper.[[span_]][[/span]]produces a marker with_emptyParagraphStrip: truethat absorbs adjacent line breaks.Spans support nesting -- a
[[span]]inside another[[span]]will correctly find its own[[/span]]closing tag.The
closeSpanRulehandles orphaned[[/span]]tags that result from paragraph-break splitting. These wrap preceding inline content into a span, matching Wikidot's behavior.