mirror of https://github.com/calzoneman/sync.git
Fix edge case of emotes directly succeeding one another in a message
This commit is contained in:
parent
de145d00c7
commit
43be6402a0
|
@ -2558,7 +2558,7 @@ Channel.prototype.validateEmote = function (f) {
|
||||||
|
|
||||||
var s = f.name.replace(/\\\.\?\+\*\$\^\(\)\[\]\{\}/g, "\\$1");
|
var s = f.name.replace(/\\\.\?\+\*\$\^\(\)\[\]\{\}/g, "\\$1");
|
||||||
s = s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
s = s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
||||||
s = "(^|\\s)" + s + "($|\\s)";
|
s = "(^|\\s)" + s + "(?!\\S)";
|
||||||
f.source = s;
|
f.source = s;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -2323,7 +2323,7 @@ function execEmotes(msg) {
|
||||||
|
|
||||||
CHANNEL.emotes.forEach(function (e) {
|
CHANNEL.emotes.forEach(function (e) {
|
||||||
msg = msg.replace(e.regex, '$1<img class="channel-emote" src="' +
|
msg = msg.replace(e.regex, '$1<img class="channel-emote" src="' +
|
||||||
e.image + '" title="' + e.name + '">$2');
|
e.image + '" title="' + e.name + '">');
|
||||||
});
|
});
|
||||||
|
|
||||||
return msg;
|
return msg;
|
||||||
|
|
Loading…
Reference in New Issue