Text reflow woes (or: I want bullets back!)y

On 1/18/20 10:18 PM, Aaron Janse wrote:
> Speaking of these...what happens when a client encounters this:
> 
> ** Foo
> ** Bar
> ** Baz
> 
> i.e. a bunch of allegedly nested list items which are not emedded in a
> higher-level list?

Line 1: A list has started at depth 2. Display a depth 2 list item.

Line 2: A list has continued at depth 2.
Display another depth 2 list item.

Line 3: A list has continued at depth 2.
Display another depth 2 list item.

Pretty straight forward if we're just processing line by line. It's
every-so-slightly trickier if we're working in ordered lists. You'll
want to keep an ordinal stack.

+ item 1
++ sub item 1
+++ sub-sub item 1
+++ sub-sub item 2
++ sub item 2
+++ a new sub-sub item 1
++ sub item 3
+ item 2

As you push deeper you'll want to keep references to those items at a
higher level so you can continue to number when you pop back out. Upon
popping, though, you can reset the deeper list ordinal. At least, that's
how I'd handle it.

What constitutes the end of an ordered list? Unordered lists are "dumb"
in that they just display their appropriate depth no matter what, but
the ordered lists need to keep track of that state. Does a non-list line
break the list? What about empty lines?

+ is this list

+ still counting

+ up to 3?

---

Previous in thread (130 of 148): 🗣️ Sean Conner (sean (a) conman.org)

Next in thread (132 of 148): 🗣️ solderpunk (solderpunk (a) SDF.ORG)

View entire thread.