From 43be6402a018373323a7bcf497b4bbd7c2322b33 Mon Sep 17 00:00:00 2001 From: calzoneman Date: Thu, 27 Mar 2014 11:03:27 -0500 Subject: [PATCH] Fix edge case of emotes directly succeeding one another in a message --- lib/channel.js | 2 +- www/js/util.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/channel.js b/lib/channel.js index 4a8e9505..bec3c73d 100644 --- a/lib/channel.js +++ b/lib/channel.js @@ -2558,7 +2558,7 @@ Channel.prototype.validateEmote = function (f) { var s = f.name.replace(/\\\.\?\+\*\$\^\(\)\[\]\{\}/g, "\\$1"); s = s.replace(/&/g, "&").replace(//g, ">"); - s = "(^|\\s)" + s + "($|\\s)"; + s = "(^|\\s)" + s + "(?!\\S)"; f.source = s; try { diff --git a/www/js/util.js b/www/js/util.js index 022c0e2f..803ef12b 100644 --- a/www/js/util.js +++ b/www/js/util.js @@ -2323,7 +2323,7 @@ function execEmotes(msg) { CHANNEL.emotes.forEach(function (e) { msg = msg.replace(e.regex, '$1$2'); + e.image + '" title="' + e.name + '">'); }); return msg;