diff --git a/js/filters.js b/js/filters.js index 886dc6b..4f0d6d9 100644 --- a/js/filters.js +++ b/js/filters.js @@ -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; } };