(node)
| 12517 | } |
| 12518 | } |
| 12519 | function walk(node) { |
| 12520 | if (node.nodeType == 1) { |
| 12521 | var cmText = node.getAttribute("cm-text") |
| 12522 | if (cmText) { |
| 12523 | addText(cmText) |
| 12524 | return |
| 12525 | } |
| 12526 | var markerID = node.getAttribute("cm-marker"), |
| 12527 | range$$1 |
| 12528 | if (markerID) { |
| 12529 | var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID)) |
| 12530 | if (found.length && (range$$1 = found[0].find(0))) { |
| 12531 | addText(getBetween(cm.doc, range$$1.from, range$$1.to).join(lineSep)) |
| 12532 | } |
| 12533 | return |
| 12534 | } |
| 12535 | if (node.getAttribute("contenteditable") == "false") { |
| 12536 | return |
| 12537 | } |
| 12538 | var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName) |
| 12539 | if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { |
| 12540 | return |
| 12541 | } |
| 12542 | |
| 12543 | if (isBlock) { |
| 12544 | close() |
| 12545 | } |
| 12546 | for (var i = 0; i < node.childNodes.length; i++) { |
| 12547 | walk(node.childNodes[i]) |
| 12548 | } |
| 12549 | |
| 12550 | if (/^(pre|p)$/i.test(node.nodeName)) { |
| 12551 | extraLinebreak = true |
| 12552 | } |
| 12553 | if (isBlock) { |
| 12554 | closing = true |
| 12555 | } |
| 12556 | } else if (node.nodeType == 3) { |
| 12557 | addText(node.nodeValue.replace(/\u200b/g, "").replace(/\u00a0/g, " ")) |
| 12558 | } |
| 12559 | } |
| 12560 | for (;;) { |
| 12561 | walk(from) |
| 12562 | if (from == to) { |
no test coverage detected