mirror of https://github.com/zulip/zulip.git
13 lines
467 B
JavaScript
13 lines
467 B
JavaScript
|
/* eslint-env browser */
|
|||
|
|
|||
|
// PhantomJS doesn’t support new DOMParser().parseFromString(…, "text/html").
|
|||
|
var real_parseFromString = DOMParser.prototype.parseFromString;
|
|||
|
DOMParser.prototype.parseFromString = function (string, type) {
|
|||
|
if (type === "text/html") {
|
|||
|
var doc = document.implementation.createHTMLDocument("");
|
|||
|
doc.documentElement.innerHTML = string;
|
|||
|
return doc;
|
|||
|
}
|
|||
|
return real_parseFromString.apply(this, arguments);
|
|||
|
};
|