Fix #154
This commit is contained in:
parent
1c2728c9f8
commit
9761a99c01
|
@ -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++) {
|
||||||
|
|
Loading…
Reference in a new issue