loose list appears unexpectedly when using tight lists
I tried to write three separate lists. However, it turns out to be one loose list. This behavior is unintuitive to me. Maybe there could be a better heuristic to loose list rendering, or an option to turn it off?
- a
- b
- c
- d
- e
REL: https://github.com/jgm/djot.js/issues/91
The syntax description describes how we group list items into groups. Essentially, we group consecutive items of the same type, where the types are defined by marker style. One possible change would be to track whether the list item is followed by a blank line -- call these items "spaced" -- and say that a list containing nonspaced items can contain at most one spaced item, at the end, and a list containing spaced items can contain at most one nonspaced item, at the end.
In the case at hand you can achieve three different tight lists by putting a comment between them:
- a
- b
{%x}
- c
{%x}
- d
- e
Not very pretty but it works!
my solution:
- a
- b
{}
- c
{}
- d
- e
Oh, totally empty "attributes"! I didn't even consider that that might work!
This method is not future-proof because empty attributes { } don't exist in the spec. Some parsers could potentially interpret them as text. The best approach is to use different markers
- a
- b
+ c
- d
- e
The best approach is to use different markers
This is the right, non-hacky way to do it. It is also how one does it in Markdown.