Incomplete

1.0 (2015-07-16)

Block Elements

FIXME

Notes

Examples

FIXME

Specification

A block element starts with a block declaration (except for various shorthand cases described below). A block declaration begins an indented line with a left square bracket ([) and a QName, followed by either a right square bracket (]) or whitespace. If whitespace follows the block name, an attribute list is opened, and the block declaration continues until it is closed, possibly spanning multiple lines. There must be no non-whitespace content on the line following the end of the block declaration.

The line following the block declarataion defines that block element's inner indent. If that line is blank, or if it's indented less than the outer indent of the block element, the block element is empty. If a block element has an inner indent greater than its outer indent, it continues consuming child content as long as non-blank lines are indented to at least that level.

If a block element has an inner indent equal to its outer indent, it consumes child content according to the following rules:

  • Starter content refers to an info segment, a title element, a desc element, and a cite element. It may optionally be consumed, as described in the following steps.

  • If the block element is a list, steps, terms or tree element, it consumes optionally starter content and then all elements at the same indent level as long as they are item elements. Note that the item elements themselves may consume same-level child content. Blank lines do not affect this case.

  • If the block element is a table element, it consumes optionally starter content and then all elements at the same indent level as long as they are thead, tfoot, tbody, or tr elements. Note that these elements may themselves consume same-level child content. Blank lines do not affect this case.

  • If the block element is a thead, tfoot, or tbody element, it consumes optionally starter content and then all elements at the same indent level as long as they are tr elements. Note that the tr elements may themselves consume same-level child content. Blank lines do not affect this case.

  • If the block element is a tr element, it consumes optionally starter content and then all elements at the same indent level as long as they are th or td elements. Note that these elements may themselves consume same-level child content. Blank lines do not affect this case.

  • Otherwise, the element consumes optionally starter content followed by at most one block element at the same level. A blank line always breaks out of the block element in this case.

If the indented line is normal text content and the current block element is not a leaf element, a Mallard p element is implicitly created with its outer and inner indent set to the indentation of the line.

© 2015 Shaun McCance
cc-by-sa 3.0 (us)

This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.

As a special exception, the copyright holders give you permission to copy, modify, and distribute the example code contained in this document under the terms of your choosing, without restriction.

Powered by
Mallard