/* global DOMParser: false */

export default function(html) {
  var parser = new DOMParser();
  return parser.parseFromString(html, "text/html");
}

@@ -28,122 +28,1983 @@
 */%0A%0A
-export default function(html) %7B%0A  var parser = new DOMParser();%0A  return parser.parseFromString(html, %22text/html%22);%0A%7D
+var canUseDomParser = (function() %7B%0A  try %7B%0A    var html   = %22%3Chtml%3E%3Chead%3E%3Ctitle%3EIt works!%3C/title%3E%3C/head%3E%3Cbody%3E%3C/body%3E%3C/html%3E%22,%0A        parser = new DOMParser(),%0A        doc    = parser.parseFromString(html, %22text/html%22);%0A%0A    return doc.title === %22It works!%22;%0A  %7D catch(e) %7B%0A    return false;%0A  %7D%0A%7D)();%0A%0Avar parse;%0A%0Aif (canUseDomParser) %7B%0A  parse = function(html) %7B%0A    return new DOMParser().parseFromString(html, %22text/html%22);%0A  %7D;%0A%7D else %7B%0A  parse = function(html) %7B%0A    var iframe = document.createElement(%22iframe%22);%0A%0A    iframe.src   = %22about:blank%22;%0A    iframe.style = %22display:none%22;%0A%0A    document.body.appendChild(iframe);%0A%0A    try %7B%0A      var doc = iframe.contentDocument;%0A%0A      doc.open();%0A      doc.write(html);%0A      doc.close();%0A%0A      return doc;%0A    %7D finally %7B%0A      document.body.removeChild(iframe);%0A    %7D%0A  %7D;%0A%7D%0A%0A// https://github.com/ariya/phantomjs/issues/11323%0A// https://github.com/ariya/phantomjs/issues/11906%0A%0Avar needHeadTagWorkAround = (function() %7B%0A  var html = %22%3Chtml%3E%3Chead%3E%3Cmeta name=%5C%22referrer%5C%22 content=%5C%22origin%5C%22%3E%3Clink rel=%5C%22stylesheet%5C%22 type=%5C%22text/css%5C%22 href=%5C%22news.css?BtneZCpVoHEQRJYJXD1G%5C%22%3E%3Clink rel=%5C%22shortcut icon%5C%22 href=%5C%22favicon.ico%5C%22%3E%3Clink rel=%5C%22alternate%5C%22 type=%5C%22application/rss+xml%5C%22 title=%5C%22RSS%5C%22 href=%5C%22rss%5C%22%3E%3Cscript type=%5C%22text/javascript%5C%22%3E%5Cnfunction byId(id) %7B%5Cn  return document.getElementById(id);%5Cn%7D%5Cn%5Cnfunction vote(node) %7B%5Cn  var v = node.id.split(/_/);   // %7B'up', '123'%7D%5Cn  var item = v%5B1%5D;%5Cn%5Cn  // hide arrows%5Cn  byId('up_'   + item).style.visibility = 'hidden';%5Cn  byId('down_' + item).style.visibility = 'hidden';%5Cn%5Cn  // ping server%5Cn  var ping = new Image();%5Cn  ping.src = node.href;%5Cn%5Cn  return false; // cancel browser nav%5Cn%7D %3C/script%3E%3Ctitle%3EIt works!%3C/title%3E%3C/head%3E%3Cbody%3E%3C/body%3E%3C/html%3E%22;%0A  return parse(html).title !== %22It works!%22;%0A%7D)();%0A%0Aif (needHeadTagWorkAround) %7B%0A  var _parse = parse;%0A%0A  parse = function(html) %7B%0A    return _parse(html.replace(/%3Chead%5B%5Cs%5CS%5D+?%3C%5C/head%3E/g, ''));%0A  %7D;%0A%7D%0A%0Aexport default parse;
 %0A

Fix build for phantomjs