Fixes #721. Firefox insertAdjacentHTML updating text nodes with "beforeend" instead of creating new ones.

This commit is contained in:
Marco Lamberto 2015-08-04 12:16:29 +02:00
parent a9ab36388b
commit 9a42242454

View file

@ -636,7 +636,12 @@ var m = (function app(window, undefined) {
}
else nextSibling.insertAdjacentHTML("beforebegin", data);
}
else parentElement.insertAdjacentHTML("beforeend", data);
else {
if (window.Range && window.Range.prototype.createContextualFragment) {
parentElement.appendChild($document.createRange().createContextualFragment(data));
}
else parentElement.insertAdjacentHTML("beforeend", data);
}
var nodes = [];
while (parentElement.childNodes[index] !== nextSibling) {
nodes.push(parentElement.childNodes[index]);