Skip to content

Fix spec violation on empty-list-item-cannot-interrupt-paragrph rule#681

Merged
Martin1887 merged 1 commit intopulldown-cmark:masterfrom
notriddle:notriddle/empty-list-item
Jul 1, 2023
Merged

Fix spec violation on empty-list-item-cannot-interrupt-paragrph rule#681
Martin1887 merged 1 commit intopulldown-cmark:masterfrom
notriddle:notriddle/empty-list-item

Conversation

@notriddle
Copy link
Collaborator

@notriddle notriddle commented Jun 27, 2023

Fixes #680

This was definitely a spec violation. Emphasis mine.

The following rules define list items:

  1. Basic case. If a sequence of lines Ls constitute a sequence of blocks Bs starting with a character other than a space or tab, and M is a list marker of width W followed by 1 ≤ N ≤ 4 spaces of indentation, then the result of prepending M and the following spaces to the first line of Ls, and indenting subsequent lines of Ls by W + N spaces, is a list item with Bs as its contents. 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.

    Exceptions:

    1. When the first list item in a list interrupts a paragraph—that is, when it starts on a line that would otherwise count as paragraph continuation text—then (a) the lines Ls must not begin with a blank line, and (b) if the list item is ordered, the start number must be 1.

@notriddle notriddle force-pushed the notriddle/empty-list-item branch from 72122e3 to f32e71e Compare June 27, 2023 19:08
@Martin1887
Copy link
Collaborator

Thanks for your contribution, it looks fine.

@notriddle notriddle force-pushed the notriddle/empty-list-item branch from f32e71e to 38f2ffe Compare June 29, 2023 15:25
@notriddle
Copy link
Collaborator Author

@Martin1887 Yeah, that file should not be there.

> The following rules define
> [list items](https://spec.commonmark.org/0.30/#list-items):
>
>  1. Basic case. If a sequence of lines Ls constitute a sequence of
>     blocks Bs starting with a character other than a space or tab,
>     and M is a list marker of width W followed by 1 ≤ N ≤ 4 spaces of
>     indentation, then the result of prepending M and the following
>     spaces to the first line of Ls*, and indenting subsequent lines
>     of Ls by W + N spaces, is a list item with Bs as its contents.
>     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.
>
>     Exceptions:
>      1. When the first list item in a list interrupts a paragraph—
>         that is, when it starts on a line that would otherwise count
>         as paragraph continuation text—then (a) *the lines Ls must
>         not begin with a blank line*, and (b) if the list item is
>         ordered, the start number must be 1.
@notriddle notriddle force-pushed the notriddle/empty-list-item branch from 38f2ffe to 31014ed Compare June 29, 2023 18:18
@Martin1887 Martin1887 merged commit 3a7cc9b into pulldown-cmark:master Jul 1, 2023
@notriddle notriddle deleted the notriddle/empty-list-item branch July 1, 2023 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lists are parsed in places that cmark doesn't see them

2 participants