hunk.code_window:   function filterOutParent(node) {
       if (parents.indexOf(node) > -1) {
         return null;
       }
     }
  
hunk.labels: keep replace replace replace replace replace keep
hunk.after_edit:   // Add a root node around the cloned nodes
     var root = new domhandler.Document(clone);
     clone.forEach(function (node) {
       node.parent = root;
     });
  
hunk.file_path: lib/utils.js
hunk.type: replace
file: /*
    Module Dependencies
  */
  var htmlparser = require('htmlparser2');
  var parse5 = require('parse5');
  var htmlparser2Adapter = require('parse5-htmlparser2-tree-adapter');
  
  /*
    Parser
  */
  exports = module.exports = function parse(content, options, isDocument) {
    // options = options || $.fn.options;
  
    var dom;
  
    if (typeof Buffer !== 'undefined' && Buffer.isBuffer(content)) {
      content = content.toString();
    }
  
    if (typeof content === 'string') {
      var useHtmlParser2 = options.xmlMode || options._useHtmlParser2;
  
      dom = useHtmlParser2
        ? htmlparser.parseDocument(content, options)
        : parseWithParse5(content, options, isDocument);
    } else {
      if (
        typeof content === 'object' &&
        content != null &&
        content.type === 'root'
      ) {
        dom = content;
      } else {
        // Generic root element
        var root = parse('', options, false);
        root.children.length = 0;
  
        // Update the dom using the root
        exports.update(content, root);
  
        dom = root;
      }
    }
  
    return dom;
  };
  
  function parseWithParse5(content, options, isDocument) {
    var parse = isDocument ? parse5.parse : parse5.parseFragment;
  
    return parse(content, {
      treeAdapter: htmlparser2Adapter,
      sourceCodeLocationInfo: options.sourceCodeLocationInfo,
    });
  }
  
  /*
    Update the dom structure, for one changed layer
  */
  exports.update = function (arr, parent) {
    // normalize
    if (!Array.isArray(arr)) arr = [arr];
  
    // Update parent
    if (parent) {
      parent.children = arr;
    } else {
      parent = null;
    }
  
    // Update neighbors
    for (var i = 0; i < arr.length; i++) {
      var node = arr[i];
  
      // Cleanly remove existing nodes from their previous structures.
      var oldParent = node.parent;
      var oldSiblings = oldParent && oldParent.children;
      if (oldSiblings && oldSiblings !== arr) {
        oldSiblings.splice(oldSiblings.indexOf(node), 1);
        if (node.prev) {
          node.prev.next = node.next;
        }
        if (node.next) {
          node.next.prev = node.prev;
        }
      }
  
      if (parent) {
        node.prev = arr[i - 1] || null;
        node.next = arr[i + 1] || null;
      } else {
        node.prev = node.next = null;
      }
  
      node.parent = parent;
    }
  
    return parent;
  };
  
  // module.exports = $.extend(exports);
  