Markup spec/BNF/Special block

Special blocks are things like itemized lists starting with * ; they can only be specified at the start of a line and usually run till the end of the line.

The dots need to be filled in.

Horizontal rule
A horizontal rule is specified by 4 or more dashes. It is translated to an &lt;hr&gt; element.

If the inline-text is present, it is not wrapped in a &lt;p&gt; element.

Heading
A level-n heading is translated to an &lt;hn&gt; element.

The alternatives in the first rule need to be tried from left to right.

Some notes (as implied by the grammar):
 * An unterminated heading tag is treated as normal text.
 * Unbalanced tags are treated as the shorter of the two tags (i.e. ==== heading == renders as the level 2 heading == heading)
 * More than 6 = signs are treated as 6, with the extra symbols being included in the header.

List item
Semantics:
 *  and   are translated to a &lt;dd> element, wrapped in a &lt;dl>
 * A  is translated to a &lt;li> element wrapped in a &lt;ul>.
 * An  is translated to a &lt;li> element wrapped in a &lt;ol>.
 * A <defined-term></tt> is translated to a &lt;dt> element wrapped in a &lt;dl>.

Notes:
 * The grouping of successive list items cannot be captured in EBNF. The simplest approach would appear to be a second pass whereby successive pairings of close/open list are eliminated. For example, <ol><li>Foo</li> </ol><ol> <li>Boo</li></ol> would be rewritten as <ol><li>Foo</li><li>Boo</li></ol>
 * <list-item></tt> and <defined-term></tt> are obviously matched in preference to <inline-text></tt>. The user has to insert whitespace in order to get inline-text starting with #, ;, * or :.
 * The current parser accepts a wide range of syntax than the above, allowing other list items to appear after a definition list . This appears to be arbitrary, unpredictable and not particularly useful. See bug11894.

Table
From meta...minor reformatting

Space block
Starting a line with a space creates a pre-formatted block of text similar to using &lt;pre>. The big difference is that the contained text is still parsed and rendered normally.


 * Rendering
 * The block is surrounded with &lt;pre>. White space and newlines are preserved literally.
 * Note that the first line of a space block must have text in it. Subsequent lines can be composed of just spaces.