MCPcopy Create free account
hub / github.com/editablejs/editable / addLevel

Function addLevel

packages/plugins/list/src/task/deserializer/html.ts:63–74  ·  view source on GitHub ↗
(list: List, level = 0)

Source from the content-addressed store, hash-verified

61 })
62 } else if (nodeName === 'LI') {
63 const addLevel = (list: List, level = 0) => {
64 list.level = level + 1
65 if (list.type === TASK_LIST_KEY) {
66 list.key = key
67 }
68 List.setIndent(editor, list)
69 list.children.forEach(child => {
70 if (editor.isList(child)) {
71 addLevel(child, list.level)
72 }
73 })
74 }
75 const children: Descendant[] = []
76 // 遍历 list 子节点
77 let isAddList = false

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…