This commit is contained in:
calzoneman 2013-05-27 14:32:24 -04:00
parent 1c2728c9f8
commit 9761a99c01

View file

@ -1588,12 +1588,12 @@ Channel.prototype.chainMessage = function(user, msg, data) {
} }
Channel.prototype.filterMessage = function(msg) { Channel.prototype.filterMessage = function(msg) {
const link = /((?:(?:https?)|(?:ftp))(?::\/\/[0-9a-zA-Z\.]+(?::[0-9]+)?[^\s$]+))/g; const link = /((?:(?:https?)|(?:ftp))(?::\/\/[0-9a-zA-Z\.]+(?::[0-9]+)?[^\s'"$]+))/g;
var subs = msg.split(link); var subs = msg.split(link);
// Apply other filters // Apply other filters
for(var j = 0; j < subs.length; j++) { for(var j = 0; j < subs.length; j++) {
if(subs[j].match(link)) { if(subs[j].match(link)) {
subs[j] = subs[j].replace(link, "<a href=\"$1\" target=\"blank\">$1</a>"); subs[j] = subs[j].replace(link, "<a href=\"$1\" target=\"_blank\">$1</a>");
continue; continue;
} }
for(var i = 0; i < this.filters.length; i++) { for(var i = 0; i < this.filters.length; i++) {