Decide whether a non-indented line interrupts an indented block form
An indented block form is defined as one or more contiguous lines indented by at least one space. This is an implicit structure that produces a literal block in the parsed document (the ASG).
(In pre-spec AsciiDoc, this was referred to as a literal paragraph, but we've since decided to name it a literal block with the indented form to make the terminology more accurate and consistent).
A question that has come up when defining the grammar is what to do if a subsequent line is not indented (and not otherwise an interrupting line). In other words, can a paragraph interrupt an indented literal block? Consider the following case:
indented
not indented
In both Asciidoctor and its predecessor, the non-indented line does not interrupt the indented block form. Thus, only the first line has to be indented by at least one space. This parsing behavior mandates that an adjacent paragraph must be separated by at least one empty line. In other words, a non-indented line cannot interrupt the indented block form, but is rather consumed as part of it.
There are two reasons why this behavior may be problematic:
- It's not consistent with other markup languages, Markdown in particular. (rST also treats it as an interrupting line, though the indented block is a blockquote)
- According to CommonMark, "A blank line is not needed ... between a code block and a following paragraph."
- It's makes it more nuanced to explain and to identify in the source.
There's one other important reason this should be considered. The next list item should be allowed to interrupt the indented block.
* first item
indented
* second next item
However, it currently is not permitted, which is definitely surprising. And yet the list item is permitted to interrupt an attached paragraph. The interruption rules just seem inconsistent in this regard.
It's very unlikely that existing documents rely on this behavior since the general practice is to surround the indented block by empty lines. But in the event that it does occur, the parser must have deterministic behavior. I think we should at least discuss changing the rule so that a non-indented line acts as an interrupting line, meaning it's not consumed as part of the indented block.