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

Function addLevel

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

Source from the content-addressed store, hash-verified

39 })
40 } else if (nodeName === 'LI') {
41 const addLevel = (list: List, level = 0) => {
42 list.level = level + 1
43 if (list.type === UNORDERED_LIST_KEY) {
44 list.key = key
45 }
46 List.setIndent(editor, list)
47 list.children.forEach(child => {
48 if (editor.isList(child)) {
49 addLevel(child, list.level)
50 }
51 })
52 }
53 const children: Descendant[] = []
54 // 遍历 list 子节点
55 let isAddList = false

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…