Fix edge case of emotes directly succeeding one another in a message

This commit is contained in:
calzoneman 2014-03-27 11:03:27 -05:00
parent de145d00c7
commit 43be6402a0
2 changed files with 2 additions and 2 deletions

View File

@ -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, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"); s = s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
s = "(^|\\s)" + s + "($|\\s)"; s = "(^|\\s)" + s + "(?!\\S)";
f.source = s; f.source = s;
try { try {

View File

@ -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;