From 01f213147e548d324426fa2d8a0903259532ab08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Wed, 5 Mar 2014 10:56:36 +0000 Subject: [PATCH] Tweak channel highlighting regex Don't require white space at the start, punctuation marks are good, too. --- js/glowingbear.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/glowingbear.js b/js/glowingbear.js index f78eb1c..713713c 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -28,7 +28,7 @@ weechat.filter('irclinky', ['$filter', function($filter) { // 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 # and having at least one letter in them. - var channelRegex = /(^|\s)(#[a-z0-9-_]*[a-z][a-z0-9-_]*)/gmi; + var channelRegex = /(^|[\s,.:;?!"'()/\\])(#+[a-z0-9-_]*[a-z][a-z0-9-_]*)/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');