From 9d34a1ca0e87e3525e12208436a2d54b65974bd1 Mon Sep 17 00:00:00 2001 From: Jack Allnutt Date: Sat, 17 Sep 2011 17:30:01 +0100 Subject: [PATCH] Apply channel linking before colour linking so colours aren't interpreted as channels --- js/front.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/front.js b/js/front.js index e0c107f..b699f7c 100644 --- a/js/front.js +++ b/js/front.js @@ -1242,6 +1242,10 @@ kiwi.front = { format: function (msg) { var re; + if ((!msg) || (typeof msg !== 'string')) { + return; + } + // bold if (msg.indexOf(String.fromCharCode(2)) !== -1) { next = ''; @@ -1572,14 +1576,14 @@ Tabview.prototype.addMsg = function (time, nick, msg, type, style) { msg = ''; } - msg = kiwi.front.format(msg); - // Make the channels clickable re = new RegExp('\\B(' + kiwi.gateway.channel_prefix + '[^ ,.\\007]+)', 'g'); msg = msg.replace(re, function (match) { return '' + match + ''; }); + msg = kiwi.front.format(msg); + // Build up and add the line line_msg = $('
' + time + '
' + nick + '
' + msg + '
'); this.div.append(line_msg); -- 2.25.1