Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Closed
ikatyang opened this issue Apr 25, 2018 · 1 comment
Closed
Labels
remark-parse 👶 semver/patch This is a backwards-compatible fix 🐛 type/bug This is a problem

Comments

@ikatyang
Copy link
Contributor

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"
                            }
                        ]
                    }
                ]
            }
        ]
    }
]
@ChristianMurphy
Copy link
Member

https://spec.commonmark.org/0.28/#example-269

Pull requests are welcome!

@ChristianMurphy ChristianMurphy added 🐛 type/bug This is a problem 👶 semver/patch This is a backwards-compatible fix remark-parse needs pr labels Jul 24, 2018
@wooorm wooorm mentioned this issue Oct 6, 2018
@wooorm wooorm closed this as completed in aab3c3e Oct 14, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
remark-parse 👶 semver/patch This is a backwards-compatible fix 🐛 type/bug This is a problem
Development

No branches or pull requests

2 participants