Fix linkification target

The target attribute was passed to the wrong filter
This commit is contained in:
Lorenz Hübschle-Schneider 2014-11-06 16:31:31 +01:00
commit 1f601e56c8
2 changed files with 4 additions and 7 deletions

View file

@ -25,7 +25,7 @@ weechat.filter('toArray', function () {
});
weechat.filter('irclinky', ['$filter', function($filter) {
return function(text, target) {
return function(text) {
if (!text) {
return text;
}
@ -64,9 +64,6 @@ weechat.filter('DOMfilter', ['$filter', '$sce', function($filter, $sce) {
return text;
}
// hacky way to pass an extra argument without using .apply, which
// would require assembling an argument array. PERFORMANCE!!!
var extraArgument = (arguments.length > 2) ? arguments[2] : null;
var filterFunction = $filter(filter);
var el = document.createElement('div');
el.innerHTML = text;
@ -74,7 +71,7 @@ weechat.filter('DOMfilter', ['$filter', '$sce', function($filter, $sce) {
// Recursive DOM-walking function applying the filter to the text nodes
var process = function(node) {
if (node.nodeType === 3) { // text node
var value = filterFunction(node.nodeValue, extraArgument);
var value = filterFunction(node.nodeValue);
if (value !== node.nodeValue) {
// we changed something. create a new node to replace the current one
// we could also only add its children but that would probably incur