Block rule for Wikidot [[div]] and [[div_]] container blocks.
[[div]] wraps its body content in a <div> element, with full
paragraph processing for the body. [[div_]] (paragraph strip mode)
unwraps the first and last paragraphs so their content appears directly
inside the <div>, while middle paragraphs keep their <p> wrappers.
Both variants accept HTML attributes (class, style, id, etc.) on the
opening tag.
Wikidot-specific edge cases:
The opening ]] MUST be followed by a NEWLINE for the block to be
recognised. [[div]]inline[[/div]] is NOT a valid div -- it becomes
a failed div (see consumeFailedDiv()).
When a div fails, everything from the opening [[div]] through the
last [[/div]] is collected as a single paragraph of text/line-break
elements. Blank lines within that span are silently removed.
[[div_]] uses unwrapEdgeParagraphs() to strip paragraph
wrappers from the first and last elements.
Block rule for Wikidot
[[div]]and[[div_]]container blocks.[[div]]wraps its body content in a<div>element, with full paragraph processing for the body.[[div_]](paragraph strip mode) unwraps the first and last paragraphs so their content appears directly inside the<div>, while middle paragraphs keep their<p>wrappers.Both variants accept HTML attributes (class, style, id, etc.) on the opening tag.
Wikidot-specific edge cases:
]]MUST be followed by a NEWLINE for the block to be recognised.[[div]]inline[[/div]]is NOT a valid div -- it becomes a failed div (seeconsumeFailedDiv()).[[div]]through the last[[/div]]is collected as a single paragraph of text/line-break elements. Blank lines within that span are silently removed.[[div_]]usesunwrapEdgeParagraphs()to strip paragraph wrappers from the first and last elements.