I need to create nested list objects like :
1. Abc
2. def
a. abc
i. lmn
ii. opq
b. def
3. ghi
I am using Slate Js as my editor where when a user presses tab I have added the code where the node is updated with its level :
if (event.key === "Tab") {
event.preventDefault();
let currentNode = Editor.above(editor,{at : editor.selection})[0];
if(currentNode.type === "listItem"){
let newLevel = currentNode.level ? currentNode.level + 1 : 1;
Transforms.setNodes(editor, {level : newLevel});
}}
Here the level is getting added to the node but I cannot nest this data into a tree structure as slateJs only allows three level of nesting of nodes and it needs a text key in the third level.