diff --git a/js/plugins.js b/js/plugins.js index 4bdb710..b7e7c4f 100644 --- a/js/plugins.js +++ b/js/plugins.js @@ -33,7 +33,7 @@ var urlRegexp = /(?:(?:https?|ftp):\/\/|www\.|ftp\.)\S*[^\s.;,(){}<>]/g; var UrlPlugin = function(name, urlCallback) { return { contentForMessage: function(message) { - var urls = message.match(urlRegexp); + var urls = _.uniq(message.match(urlRegexp)); var content = []; for (var i = 0; urls && i < urls.length; i++) { diff --git a/test/karma.conf.js b/test/karma.conf.js index 8bafa0c..43c86e7 100644 --- a/test/karma.conf.js +++ b/test/karma.conf.js @@ -9,6 +9,7 @@ module.exports = function(config){ 'bower_components/angular-mocks/angular-mocks.js', 'bower_components/angular-sanitize/angular-sanitize.js', 'bower_components/angular-touch/angular-touch.js', + 'bower_components/underscore/underscore.js', 'js/localstorage.js', 'js/weechat.js', 'js/irc-utils.js',