Skip to content

Latest commit

 

History

History
130 lines (107 loc) · 6.13 KB

plain_list_ownership_notes.org

File metadata and controls

130 lines (107 loc) · 6.13 KB

Test 1

Source

1. foo

   1. bar

   2. baz

2. lorem

ipsum

Ownership

This table is just showing ownership for the plain list items, not the containing plain list nor the elements inside each item.

Plain List ItemOwns trailing blank lines
foo (includes bar baz)Yes
barYes
bazYes
loremNo

Analysis

In this test case, we see that the only list item that doesn’t own its trailing blank lines is “lorem”, the final list item of the outer-most list.

Test 2

We add “cat” as a paragraph at the end of foo which makes “baz” lose its trailing blank lines.

Source

1. foo

   1. bar

   2. baz

   cat

2. lorem

ipsum

Ownership

Plain List ItemOwns trailing blank lines
foo -> cat (includes bar baz)Yes
barYes
bazNo
loremNo

Analysis

In isolation, this implies that the final plain list item does not own its trailing blank lines, which conflicts with “baz” from test 1.

New theory: List items own their trailing blank lines unless they are both the final list item and not the final element of a list item.

Plain List ItemOwns trailing blank linesWhy
foo -> cat (includes bar baz)YesNot the final list item
barYesNot the final list item
bazNoFinal item of bar->baz and not the final element of “foo”
loremNoFinal item of foo->lorem and not contained in a list item

Test 3

So if that theory is true, taking the entire (foo -> lorem) list from test 1 and nesting it inside a list should coerce “lorem” to own its trailing blank lines since it would then be a final list item (of foo -> lorem) and the final element of the new list.

Source

1. cat
   1. foo

      1. bar

      2. baz

   2. lorem

ipsum

Ownership

Plain List ItemOwns trailing blank lines
cat (includes foo -> lorem)No
foo (includes bar baz)Yes
barYes
bazYes
loremNo

Analysis

Against expectations, we did not coerce lorem to consume its trailing blank lines. What is different between “baz” and “lorem”? Well, “baz” is contained within “foo” which has a “lorem” after it, whereas “lorem” is contained within “cat” which does not have any list items after it.

New theory: List items own their trailing blank lines unless they are both the final list item and not the final element of a non-final list item.

Plain List ItemOwns trailing blank linesWhy
cat (includes foo -> lorem)NoFinal list item and not contained in a list item
foo (includes bar baz)YesNot the final list item
barYesNot the final list item
bazYesFinal element of non-final list item
loremNoFinal list item and final element of final list item

Test 4

So if that theory is true, then we should be able to coerce lorem to consume its trailing blank lines by adding a second item to the cat list.

Source

1. cat
   1. foo

      1. bar

      2. baz

   2. lorem

2. dog

ipsum

Ownership

Plain List ItemOwns trailing blank lines
cat (includes foo -> lorem)Yes
foo (includes bar baz)Yes
barYes
bazYes
loremYes
dogNo

Analysis

For the first time our expectations were met!

Enduring theory: List items own their trailing blank lines unless they are both the final list item and not the final element of a non-final list item.

Plain List ItemOwns trailing blank linesWhy
cat (includes foo -> lorem)YesNot the final list item
foo (includes bar baz)YesNot the final list item
barYesNot the final list item
bazYesFinal element of non-final list item
loremYesFinal element of non-final list item
dogNoFinal list item and not contained in a list item