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

Function traverse

packages/plugins/list/src/styles.tsx:95–107  ·  view source on GitHub ↗
(element: Element)

Source from the content-addressed store, hash-verified

93 }
94
95 const traverse = (element: Element) => {
96 for (const child of element.children) {
97 if (Text.isText(child)) {
98 const textDom = Editable.toDOMNode(editor, child)
99 const leafs = textDom.querySelectorAll<HTMLElement>(`[${DATA_EDITABLE_LEAF}]`)
100 for (const leaf of leafs) {
101 if (!compareStyle(leaf.style)) return
102 }
103 } else {
104 traverse(child)
105 }
106 }
107 }
108 traverse(element)
109 if (font) {
110 font = font as FontStyle

Callers 1

ListElementFunction · 0.85

Calls 1

compareStyleFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…