From 68adfb6cc242b611d6113cda7ab85ed9708979b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Sun, 28 Sep 2014 20:45:29 +0200 Subject: [PATCH] Hotfix irclinky filter: only #channels &channels match HTML-escaped special chars like " m( --- js/filters.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/filters.js b/js/filters.js index 188424b..42335bd 100644 --- a/js/filters.js +++ b/js/filters.js @@ -23,12 +23,12 @@ weechat.filter('irclinky', ['$filter', function($filter) { var linkiedText = $filter('linky')(text, target); - // This regex in no way matches all IRC channel names (they could also begin with a + or an + // This regex in no way matches all IRC channel names (they could also begin with &, + or an // exclamation mark followed by 5 alphanumeric characters, and are bounded in length by 50). // However, it matches all *common* IRC channels while trying to minimise false positives. // "#1" is much more likely to be "number 1" than "IRC channel #1". - // Thus, we only match channels beginning with a # or & and having at least one letter in them. - var channelRegex = /(^|[\s,.:;?!"'()+@-])((&|#+)[^\x00\x07\r\n\s,:]*[a-z][^\x00\x07\r\n\s,:]*)/gmi; + // Thus, we only match channels beginning with a # and having at least one letter in them. + var channelRegex = /(^|[\s,.:;?!"'()+@-])(#+[^\x00\x07\r\n\s,:]*[a-z][^\x00\x07\r\n\s,:]*)/gmi; // This is SUPER nasty, but ng-click does not work inside a filter, as the markup has to be $compiled first, which is not possible in filter afaik. // Therefore, get the scope, fire the method, and $apply. Yuck. I sincerely hope someone finds a better way of doing this. linkiedText = linkiedText.replace(channelRegex, '$1$2');