Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

No break possible between Lists & List items are each their own list #29

Open
aneroid opened this issue Aug 19, 2023 · 0 comments
Open

Comments

@aneroid
Copy link

aneroid commented Aug 19, 2023

Summary:

  1. Once a list has been started, the next paragraphs and lines are always a list
  2. The first non-list item becomes part of the previous list and the all subsequent lines are list items.
  3. List items are each their own list

Using the following markdown as test input:

**This is the first list:**

- bullet line one
- not indented line


**the 2nd list**

- 2nd list, 1st item
- 2nd list, 2nd item

In the output JSON, notice the following:

  1. The items of each of the lists are treated as two separate bullestLists even though they should be part of the content of the same one.
    • Just so happens to get visually rendered as one bullet list on Atlassian.
  2. Despite having two empty lines (so 3 consecutive newlines \n's), the 2nd paragraph header gets added as list item for the first list, instead of being on its own after an to the first list.
  3. All subsequent lines after a bullet list has started become part of the list, even if not prefixed with a -. Or they become content of the last element given as a list
{
    "type": "doc",
    "content": [
        {
            "type": "paragraph",
            "content": [
                {
                    "type": "text",
                    "text": "This is the first list:",
                    "marks": [
                        {
                            "type": "strong"
                        }
                    ]
                }
            ]
        },
        {
            "type": "bulletList",
            "content": [
                {
                    "type": "listItem",
                    "content": [
                        {
                            "type": "paragraph",
                            "content": [
                                {
                                    "type": "text",
                                    "text": "bullet line one"
                                }
                            ]
                        }
                    ]
                }
            ]
        },
        {
            "type": "bulletList",
            "content": [
                {
                    "type": "listItem",
                    "content": [
                        {
                            "type": "paragraph",
                            "content": [
                                {
                                    "type": "text",
                                    "text": "not indented line"
                                }
                            ]
                        },
                        {
                            "type": "paragraph",
                            "content": [
                                {
                                    "type": "text",
                                    "text": " "
                                }
                            ]
                        },
                        {
                            "type": "paragraph",
                            "content": [
                                {
                                    "type": "text",
                                    "text": "the 2nd list",
                                    "marks": [
                                        {
                                            "type": "strong"
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            ]
        },
        {
            "type": "bulletList",
            "content": [
                {
                    "type": "listItem",
                    "content": [
                        {
                            "type": "paragraph",
                            "content": [
                                {
                                    "type": "text",
                                    "text": "2nd list, 1st item"
                                }
                            ]
                        }
                    ]
                }
            ]
        },
        {
            "type": "bulletList",
            "content": [
                {
                    "type": "listItem",
                    "content": [
                        {
                            "type": "paragraph",
                            "content": [
                                {
                                    "type": "text",
                                    "text": "2nd list, 2nd item"
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ],
    "version": 1
}

It should be something like this:

{
    "type": "doc",
    "content": [
        {
            "type": "paragraph",
            "content": [
                {
                    "type": "text",
                    "text": "This is the first list:",
                    "marks": [
                        {
                            "type": "strong"
                        }
                    ]
                }
            ]
        },
        {
            "type": "bulletList",
            "content": [
                {
                    "type": "listItem",
                    "content": [
                        {
                            "type": "paragraph",
                            "content": [
                                {
                                    "type": "text",
                                    "text": "bullet line one"
                                }
                            ]
                        }
                    ]
                },
                {
                    "type": "listItem",
                    "content": [
                        {
                            "type": "paragraph",
                            "content": [
                                {
                                    "type": "text",
                                    "text": "not indented line"
                                }
                            ]
                        }
                    ]
                }
            ]
        },
        {
            "type": "paragraph",
            "content": [
                {
                    "type": "text",
                    "text": "the 2nd list",
                    "marks": [
                        {
                            "type": "strong"
                        }
                    ]
                }
            ]
        },
        {
            "type": "bulletList",
            "content": [
                {
                    "type": "listItem",
                    "content": [
                        {
                            "type": "paragraph",
                            "content": [
                                {
                                    "type": "text",
                                    "text": "2nd list, 1st item"
                                }
                            ]
                        }
                    ]
                },
                {
                    "type": "listItem",
                    "content": [
                        {
                            "type": "paragraph",
                            "content": [
                                {
                                    "type": "text",
                                    "text": "2nd list, 2nd item"
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ],
    "version": 1
}
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

No branches or pull requests

1 participant