Fix emotes

This commit is contained in:
calzoneman 2014-02-16 01:33:38 -06:00
parent e8daf33146
commit 7711587f15
2 changed files with 4 additions and 4 deletions

View File

@ -270,7 +270,7 @@ Channel.prototype.loadState = function () {
// Emotes
if ("emotes" in data) {
data.emotes.forEach(function (e) {
self.emotes.push(e);
self.updateEmote(e);
});
}
@ -2505,7 +2505,7 @@ Channel.prototype.validateEmote = function (f) {
var s = f.name.replace(/\\\.\?\+\*\$\^\(\)\[\]\{\}/g, "\\$1");
s = s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
s = "(^|\\b)" + s + "($|\\b)";
s = "(^|\\s)" + s + "($|\\s)";
f.source = s;
try {

View File

@ -2269,8 +2269,8 @@ function execEmotes(msg) {
}
CHANNEL.emotes.forEach(function (e) {
msg = msg.replace(e.regex, '<img class="channel-emote" src="' +
e.image + '" title="' + e.name + '">');
msg = msg.replace(e.regex, '$1<img class="channel-emote" src="' +
e.image + '" title="' + e.name + '">$2');
});
return msg;