Skip to content

[CommonMark] multiple empty lines between listItems cause separate lists #332

@ikatyang

Description

@ikatyang

Subject of the issue

commonmark: true

* hello1

* hello2


* hello3

* hello4


* hello5

* hello6

Steps to reproduce

astexplorer

Expected behaviour

Same as CommonMark playground:

[
    {
        "type": "list",
        "ordered": false,
        "start": null,
        "loose": true,
        "children": [
            {
                "type": "listItem",
                "loose": true,
                "checked": null,
                "children": [
                    {
                        "type": "paragraph",
                        "children": [
                            {
                                "type": "text",
                                "value": "hello1"
                            }
                        ]
                    }
                ]
            },
            {
                "type": "listItem",
                "loose": true,
                "checked": null,
                "children": [
                    {
                        "type": "paragraph",
                        "children": [
                            {
                                "type": "text",
                                "value": "hello2"
                            }
                        ]
                    }
                ]
            },
            {
                "type": "listItem",
                "loose": true,
                "checked": null,
                "children": [
                    {
                        "type": "paragraph",
                        "children": [
                            {
                                "type": "text",
                                "value": "hello3"
                            }
                        ]
                    }
                ]
            },
            {
                "type": "listItem",
                "loose": true,
                "checked": null,
                "children": [
                    {
                        "type": "paragraph",
                        "children": [
                            {
                                "type": "text",
                                "value": "hello4"
                            }
                        ]
                    }
                ]
            },
            {
                "type": "listItem",
                "loose": true,
                "checked": null,
                "children": [
                    {
                        "type": "paragraph",
                        "children": [
                            {
                                "type": "text",
                                "value": "hello5"
                            }
                        ]
                    }
                ]
            },
            {
                "type": "listItem",
                "loose": false,
                "checked": null,
                "children": [
                    {
                        "type": "paragraph",
                        "children": [
                            {
                                "type": "text",
                                "value": "hello6"
                            }
                        ]
                    }
                ]
            }
        ]
    }
]

Actual behaviour

[
    {
        "type": "list",
        "ordered": false,
        "start": null,
        "loose": true,
        "children": [
            {
                "type": "listItem",
                "loose": true,
                "checked": null,
                "children": [
                    {
                        "type": "paragraph",
                        "children": [
                            {
                                "type": "text",
                                "value": "hello1"
                            }
                        ]
                    }
                ]
            },
            {
                "type": "listItem",
                "loose": false,
                "checked": null,
                "children": [
                    {
                        "type": "paragraph",
                        "children": [
                            {
                                "type": "text",
                                "value": "hello2"
                            }
                        ]
                    }
                ]
            }
        ]
    },
    {
        "type": "list",
        "ordered": false,
        "start": null,
        "loose": true,
        "children": [
            {
                "type": "listItem",
                "loose": true,
                "checked": null,
                "children": [
                    {
                        "type": "paragraph",
                        "children": [
                            {
                                "type": "text",
                                "value": "hello3"
                            }
                        ]
                    }
                ]
            },
            {
                "type": "listItem",
                "loose": false,
                "checked": null,
                "children": [
                    {
                        "type": "paragraph",
                        "children": [
                            {
                                "type": "text",
                                "value": "hello4"
                            }
                        ]
                    }
                ]
            }
        ]
    },
    {
        "type": "list",
        "ordered": false,
        "start": null,
        "loose": true,
        "children": [
            {
                "type": "listItem",
                "loose": true,
                "checked": null,
                "children": [
                    {
                        "type": "paragraph",
                        "children": [
                            {
                                "type": "text",
                                "value": "hello5"
                            }
                        ]
                    }
                ]
            },
            {
                "type": "listItem",
                "loose": false,
                "checked": null,
                "children": [
                    {
                        "type": "paragraph",
                        "children": [
                            {
                                "type": "text",
                                "value": "hello6"
                            }
                        ]
                    }
                ]
            }
        ]
    }
]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions