Fix DOMfilter when replacing multiple occasions

Previously, it would sometimes forget things at the end
This commit is contained in:
Lorenz Hübschle-Schneider 2014-12-30 20:23:32 +01:00
parent 1478b611da
commit 8a740b765a

View file

@ -94,13 +94,15 @@ weechat.filter('DOMfilter', ['$filter', '$sce', function($filter, $sce) {
} else {
parent.appendChild(newNode);
}
return newNode;
}
}
// recurse
if (node === undefined || node === null) return;
node = node.firstChild;
while (node) {
process(node);
node = node.nextSibling;
var nextNode = process(node);
node = (nextNode ? nextNode : node).nextSibling;
}
};