code: function getDiffNodes(expected, actual) {
  		//compute diff
  		var diff = new diff_match_patch(),
  			diffs = diff.diff_main(expected, actual),
  			html = [],
  			i,
  			pre,
  			nodes,
  			actualNodes,
  			x,
  			op,
  			data,
  			text;
  		
  		diff.diff_cleanupSemantic(diffs);
  		
  		for (x = 0; x < diffs.length; x++) {
  			op = diffs[x][0];    // Operation (insert, delete, equal)
  			data = diffs[x][1];  // Text of change.
  			text = data.replace(/&/g, "&amp;")
  				.replace(/</g, "&lt;")
  				.replace(/>/g, "&gt;")
  				.replace(/\r\n/g, "&crarr;&para;<br />")
  				.replace(/\r/g, "&crarr;<br />")
  				.replace(/\n/g, "&para;<br />");
  			
  			switch (op) {
  				case 1:
  					html[x] = "<ins>" + text + "</ins>";
  					break;
  				case -1:
  					html[x] = "<del>" + text + "</del>";
  					break;
  				case 0:
  					html[x] = "<span>" + text + "</span>";
  					break;
  			}
  			
  			if (op !== -1) {
  				i += data.length;
  			}
  		}
  		
  		html = html.join('');
  		
  		pre = doc.createElement("pre");
  		pre.innerHTML = html;
  		
  		nodes = pre.cloneNode(true).children;
  		actualNodes = [];
  		for (i = 0; i < nodes.length; i++) {
  			actualNodes[i] = nodes[i];
  		}
  		pre = null;
  		return actualNodes;
  	}
docs: adapted from diff_match_patch.diff_prettyHtml()