From b5e205fba226b3d8d94418e050022c48a37997f8 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 31 Jan 2015 22:24:43 -0800 Subject: Revised Rule 3 for list items. Previously this just applied to empty list items. It has been rewritten to apply to any list item starting with a blank line, including items like: - ``` code ``` Closes #275. --- spec.txt | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/spec.txt b/spec.txt index 21bef8c..07d2c26 100644 --- a/spec.txt +++ b/spec.txt @@ -2998,8 +2998,42 @@ the above case: . -3. **Empty list item.** A [list marker] followed by a -line containing only [whitespace] is a list item with no contents. +3. **Item starting with a blank line.** If a sequence of lines *Ls* + starting with a single [blank line] constitute a (possibly empty) + sequence of blocks *Bs*, not separated from each other by more than + one blank line, and *M* is a list marker *M* of width *W*, + then the result of prepending *M* to the first line of *Ls*, and + indenting subsequent lines of *Ls* by *W + 1* spaces, is a list + item with *Bs* as its contents. + If a line is empty, then it need not be indented. The type of the + list item (bullet or ordered) is determined by the type of its list + marker. If the list item is ordered, then it is also assigned a + start number, based on the ordered list marker. + +Here are some list items that start with a blank line but are not empty: + +. +- + foo +- + ``` + bar + ``` +- + baz +. + +. Here is an empty bullet list item: @@ -3053,6 +3087,7 @@ A list may start or end with an empty list item: . + 4. **Indentation.** If a sequence of lines *Ls* constitutes a list item according to rule #1, #2, or #3, then the result of indenting each line of *L* by 1-3 spaces (the same for each line) also constitutes a -- cgit v1.2.3