MCPcopy Create free account
hub / github.com/TruthHun/BookStack / textContent

Function textContent

static/editor.md/lib/codemirror/addon/runmode/colorize.js:16–22  ·  view source on GitHub ↗
(node, out)

Source from the content-addressed store, hash-verified

14 var isBlock = /^(p|li|div|h\\d|pre|blockquote|td)$/;
15
16 function textContent(node, out) {
17 if (node.nodeType == 3) return out.push(node.nodeValue);
18 for (var ch = node.firstChild; ch; ch = ch.nextSibling) {
19 textContent(ch, out);
20 if (isBlock.test(node.nodeType)) out.push("\n");
21 }
22 }
23
24 CodeMirror.colorize = function(collection, defaultMode) {
25 if (!collection) collection = document.body.getElementsByTagName("pre");

Callers 1

colorize.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected