diff --git a/src/headless/plugins/emoji/api.js b/src/headless/plugins/emoji/api.js index edf6ab65fb..a7c925c5e4 100644 --- a/src/headless/plugins/emoji/api.js +++ b/src/headless/plugins/emoji/api.js @@ -49,7 +49,7 @@ const emojis = { converse.emojis.shortnames = converse.emojis.list.map((m) => m.sn); const getShortNames = () => converse.emojis.shortnames.map((s) => s.replace(/[+]/g, '\\$&')).join('|'); - converse.emojis.shortnames_regex = new RegExp(getShortNames(), 'gi'); + converse.emojis.shortnames_regex = new RegExp(getShortNames(), 'g'); converse.emojis.initialized_promise.resolve(); } return converse.emojis.initialized_promise; diff --git a/src/headless/plugins/emoji/utils.js b/src/headless/plugins/emoji/utils.js index dc075ae342..d947df7e43 100644 --- a/src/headless/plugins/emoji/utils.js +++ b/src/headless/plugins/emoji/utils.js @@ -108,7 +108,7 @@ export function getShortnameReferences (text) { } const references = [...text.matchAll(converse.emojis.shortnames_regex)].filter(ref => ref[0].length > 0); return references.map(ref => { - const cp = converse.emojis.by_sn[ref[0].toLowerCase()].cp; + const cp = converse.emojis.by_sn[ref[0]].cp; return { cp, 'begin': ref.index, @@ -190,7 +190,7 @@ export function isOnlyEmojis (text) { } const emojis = words.filter(text => { const refs = getCodePointReferences(u.shortnamesToUnicode(text)); - return refs.length === 1 && (text.toLowerCase() === refs[0]['shortname'] || text === refs[0]['emoji']); + return refs.length === 1 && (text === refs[0]['shortname'] || text === refs[0]['emoji']); }); return emojis.length === words.length; }