mirror of https://github.com/calzoneman/sync.git
Fix emotes
This commit is contained in:
parent
e8daf33146
commit
7711587f15
|
@ -270,7 +270,7 @@ Channel.prototype.loadState = function () {
|
||||||
// Emotes
|
// Emotes
|
||||||
if ("emotes" in data) {
|
if ("emotes" in data) {
|
||||||
data.emotes.forEach(function (e) {
|
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");
|
var s = f.name.replace(/\\\.\?\+\*\$\^\(\)\[\]\{\}/g, "\\$1");
|
||||||
s = s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
s = s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
||||||
s = "(^|\\b)" + s + "($|\\b)";
|
s = "(^|\\s)" + s + "($|\\s)";
|
||||||
f.source = s;
|
f.source = s;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -2269,8 +2269,8 @@ function execEmotes(msg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
CHANNEL.emotes.forEach(function (e) {
|
CHANNEL.emotes.forEach(function (e) {
|
||||||
msg = msg.replace(e.regex, '<img class="channel-emote" src="' +
|
msg = msg.replace(e.regex, '$1<img class="channel-emote" src="' +
|
||||||
e.image + '" title="' + e.name + '">');
|
e.image + '" title="' + e.name + '">$2');
|
||||||
});
|
});
|
||||||
|
|
||||||
return msg;
|
return msg;
|
||||||
|
|
Loading…
Reference in New Issue