Alter EMOJI_REGEX to include end of string ($)

Fixes https://github.com/vector-im/riot-web/issues/4529 because the match must include the remainder of the query.
pull/21833/head
Luke Barnard 2017-07-06 18:11:46 +01:00
parent 3e93930dcc
commit 0a4f8ffead
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ const CATEGORY_ORDER = [
];
// Match for ":wink:" or ascii-style ";-)" provided by emojione
const EMOJI_REGEX = new RegExp('(' + asciiRegexp + '|:\\w*:?)', 'g');
const EMOJI_REGEX = new RegExp('(' + asciiRegexp + '|:\\w*:?)$', 'g');
const EMOJI_SHORTNAMES = Object.keys(EmojiData).map((key) => EmojiData[key]).sort(
(a, b) => {
if (a.category === b.category) {