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
1 changed files with 4 additions and 2 deletions

View File

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