List not rendered to specification
I hope this is the right place to ask this question.
A user of a treesitter grammar I wrote encountered this example
1. a
1. b
1. c
2. d
1. e
2. f
Rendered:
- a
- b
1. c
2. d
- e
- f
which I think is not rendered to spec on github. The reference implementation on https://spec.commonmark.org/dingus/ agrees with me that c and d should not be parsed as list items. I gave an explanation in https://github.com/MDeiml/tree-sitter-markdown/issues/27 but I'll give some extra detail here.
The relevant sections in the gfm spec are:
- Contents of list items have to be indented at least as much as the first line (see https://github.github.com/gfm/#example-273)
- List items can not be indented more than 3 spaces (see https://github.github.com/gfm/#example-267)
- Indented code blocks cannot interrupt paragraphs (see https://github.github.com/gfm/#example-83)
The implementation on github seems to interpret 2. as that everything can be a list item but interpretation as an indented code block takes precedence. The relevant part in the spec that disagrees with that is
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 Ls by 1-3 spaces (the same for each line) also constitutes a list item with the same contents and attributes. If a line is empty, then it need not be indented.
What do people here think about this?