(node, out)
| 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"); |