Skip to content

Conversation

lightningspirit
Copy link
Contributor

Editor.js now has a NestedList tool which (unfortunately) uses the same block name "list" as the simple List block tool.

As such, this adds support to nested ul and ol tags following the output showed in
https://github.com/editor-js/nested-list#output-data

Here's an example of such output data:

{
    "type" : "list",
    "data" : {
        "style" : "unordered",
        "items" : [
            {
              "content": "Apples",
              "items": [
                {
                  "content": "Red",
                  "items": []
                },
                {
                  "content": "Green",
                  "items": []
                },
              ]
            },
            {
              "content": "Bananas",
              "items": [
                {
                  "content": "Yellow",
                  "items": []
                },
              ]
            },
        ]
    }
}

Closes #30

Editor.js now has a NestedList tool which (unfortunately) uses the
same block name "list" as the simple List block tool.

As such, this adds support to nested ul and ol tags following
the output showed in
https://github.com/editor-js/nested-list#output-data

Here's an example of such output data:
```json
{
    "type" : "list",
    "data" : {
        "style" : "unordered",
        "items" : [
            {
              "content": "Apples",
              "items": [
                {
                  "content": "Red",
                  "items": []
                },
                {
                  "content": "Green",
                  "items": []
                },
              ]
            },
            {
              "content": "Bananas",
              "items": [
                {
                  "content": "Yellow",
                  "items": []
                },
              ]
            },
        ]
    }
}
```

Closes #30
@lightningspirit lightningspirit added the Bug Something isn't working label Oct 27, 2021
@lightningspirit lightningspirit merged commit c6f8927 into master Oct 27, 2021
@lightningspirit lightningspirit deleted the issue-30-nested-list branch October 27, 2021 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update List to use nested items

1 participant