MCPcopy Index your code
hub / github.com/DHTMLX/gantt / walk

Function walk

samples/common/codehighlight/codemirror.js:9180–9207  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

9178 }
9179 }
9180 function walk(node) {
9181 if (node.nodeType == 1) {
9182 var cmText = node.getAttribute("cm-text");
9183 if (cmText) {
9184 addText(cmText);
9185 return
9186 }
9187 var markerID = node.getAttribute("cm-marker"), range;
9188 if (markerID) {
9189 var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));
9190 if (found.length && (range = found[0].find(0)))
9191 { addText(getBetween(cm.doc, range.from, range.to).join(lineSep)); }
9192 return
9193 }
9194 if (node.getAttribute("contenteditable") == "false") { return }
9195 var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName);
9196 if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }
9197
9198 if (isBlock) { close(); }
9199 for (var i = 0; i < node.childNodes.length; i++)
9200 { walk(node.childNodes[i]); }
9201
9202 if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; }
9203 if (isBlock) { closing = true; }
9204 } else if (node.nodeType == 3) {
9205 addText(node.nodeValue.replace(/\u200b/g, "").replace(/\u00a0/g, " "));
9206 }
9207 }
9208 for (;;) {
9209 walk(from);
9210 if (from == to) { break }

Callers 1

domTextBetweenFunction · 0.85

Calls 5

addTextFunction · 0.85
PosFunction · 0.85
recognizeMarkerFunction · 0.85
getBetweenFunction · 0.85
closeFunction · 0.85

Tested by

no test coverage detected