From 4afb1beeb9d11594ac6d24a6c0bd83f704f9eee0 Mon Sep 17 00:00:00 2001 From: Darren Date: Sun, 2 Sep 2012 19:51:22 +0100 Subject: [PATCH] Improved link detection --- client_backbone/dev/view.js | 5 +++++ 1 file changed, 5 insertions(+) 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) + '...'; -- 2.25.1