editorjs-php icon indicating copy to clipboard operation
editorjs-php copied to clipboard

Recursive tool support?

Open nickolasjadams opened this issue 3 years ago • 2 comments

I've been struggling to write a configuration for the nestedList tool plugin.

At first I thought the documentation said this was possible with "data" and "-".

But after looking at the example and struggling, I'm wondering if I misinterpreted the docs.

Has anybody successfully written a configuration for something like this

  • content1
  • content1.1
    • content2
"type": "nestedList", 
"data": {
    "style": "unordered",
    "items": [
            {
                "content": "content1",
                "items": []
            }, 
            {
                "content": "content1.1",
                "items": [
                    {
                        "content": "content2",
                        "items": []
                    }
                ]
        }
    ]
}

nickolasjadams avatar Apr 20 '22 04:04 nickolasjadams

Hi! There is an example in Docs for the nested tool. Currently there is no support of recursive syntax.

"table": {
  "content": {
    "type": "array",
    "data": {
      "-": {
        "type": "array",
        "data": {
          "-": {
            "type": "string",
            "allowedTags": "i,b,a[href],code[class],mark[class]"
          }
        }
      }
    }
  }
}

n0str avatar Apr 20 '22 06:04 n0str

Ah. That's where I had misunderstood. I had assumed that nesting might be infinite. Thank you for clarifying! Love the work you guys have done!

nickolasjadams avatar Apr 21 '22 04:04 nickolasjadams