MCPcopy Index your code
hub / github.com/OneNoteDev/WebClipper / mergeSiblingTextNodes

Function mergeSiblingTextNodes

src/scripts/highlighting/textHighlighter.js:767–779  ·  view source on GitHub ↗
(textNode)

Source from the content-addressed store, hash-verified

765 self = this;
766
767 function mergeSiblingTextNodes(textNode) {
768 var prev = textNode.previousSibling,
769 next = textNode.nextSibling;
770
771 if (prev && prev.nodeType === NODE_TYPE.TEXT_NODE) {
772 textNode.nodeValue = prev.nodeValue + textNode.nodeValue;
773 dom(prev).remove();
774 }
775 if (next && next.nodeType === NODE_TYPE.TEXT_NODE) {
776 textNode.nodeValue = textNode.nodeValue + next.nodeValue;
777 dom(next).remove();
778 }
779 }
780
781 function removeHighlight(highlight) {
782 var textNodes = dom(highlight).unwrap();

Callers 1

removeHighlightFunction · 0.85

Calls 1

domFunction · 0.85

Tested by

no test coverage detected