From: Darren Date: Sun, 2 Sep 2012 18:51:22 +0000 (+0100) Subject: Improved link detection X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4afb1beeb9d11594ac6d24a6c0bd83f704f9eee0;p=KiwiIRC.git Improved link detection --- diff --git a/client_backbone/dev/view.js b/client_backbone/dev/view.js index eb5528b..8e24ca7 100644 --- a/client_backbone/dev/view.js +++ b/client_backbone/dev/view.js @@ -189,6 +189,11 @@ kiwi.view.Panel = Backbone.View.extend({ msg.msg = msg.msg.replace(/((https?\:\/\/|ftp\:\/\/)|(www\.))(\S+)(\w{2,4})(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]*))?/gi, function (url) { var nice; + // Add the http is no protoocol was found + if (url.match(/^www\./)) { + url = 'http://' + url; + } + nice = url; if (nice.length > 100) { nice = nice.substr(0, 100) + '...';