rem: var element = elementCreator.createElement(document); element.setAttribute("id", concatId); 
add: var childNode = matchText.cloneNode(true); var element = elementCreator.createElement(document, id, childNode); matchText.parentNode.replaceChild(element, matchText); 
context: searchwp.highlighting.NodeHighlighter = function(name) {  var self = this;  this.name = name;  /**   * Clear the highlighting for a particular document.   * @param document The document to clear.   */  this.clear = function(document) {    if (!document) {      return;    }    initNodeHighlighterMetaData(document);    // Find and remove all highlight span nodes    while (document.nodeHighlighter[this.name].count > 0) {      var concatId = this.name + --document.nodeHighlighter[this.name].count;      var oldSpan = document.getElementById(concatId);      var parent = oldSpan.parentNode;      parent.replaceChild(oldSpan.childNodes[0], oldSpan);      parent.normalize();    }  }  /**   * Highlight all instances of a word in a particular node of   * the given document.   * @param document The document   * @param node The node contained in the document.   * @param word The word to highlight.   * @param matchCase If highlighting should match case.   * @param elementCreator An element creator object (see DefaultElementCreator below).   */  this.highlight = function(document, node, word, matchCase, elementCreator) {    initNodeHighlighterMetaData(document);    var text = node.data;    if (!matchCase) {      text = text.toUpperCase();      word = word.toUpperCase();    }    var count = 0;    while (text.indexOf(word) != -1) {      var matchText = node.splitText(text.indexOf(word));      node = matchText.splitText(word.length);      var clone = matchText.cloneNode(true);      var concatId = this.name + document.nodeHighlighter[this.name].count++;      // Be sure that this id doesn't exist.      while (document.getElementById(concatId) != null) {        concatId = this.name + document.nodeHighlighter[this.name].count++;      }      var element = elementCreator.createElement(document);      element.setAttribute("id", concatId);      element.appendChild(clone);      matchText.parentNode.replaceChild(element, matchText);      // Move to next node      node = element.nextSibling;      text = node.data;      if (!matchCase) {        text = text.toUpperCase();      }      count++;    }    return count;  }  function initNodeHighlighterMetaData(document) {    if (!document.nodeHighlighter) {      document.nodeHighlighter = {};    }    if (!document.nodeHighlighter[self.name]) {      document.nodeHighlighter[self.name] = {count: 0};    }  }}
meta: 2588	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/2588/f175973a24c874662aecffa7e17cab869338a5dc/nodeHighlighter.js/clean/src/chrome/content/highlighting/nodeHighlighter.js