Commit 527e7edb authored by Mike Greiling's avatar Mike Greiling

replace emojiAlias references with normalizeEmojiName helper

parent 82d67f70
import installCustomElements from 'document-register-element'; import installCustomElements from 'document-register-element';
import { emojiMap, emojiAliases, isEmojiUnicodeSupported, getUnicodeSupportMap } from '../emoji'; import { emojiMap, normalizeEmojiName, isEmojiUnicodeSupported, getUnicodeSupportMap } from '../emoji';
installCustomElements(window); installCustomElements(window);
...@@ -10,8 +10,7 @@ function emojiImageTag(name, src) { ...@@ -10,8 +10,7 @@ function emojiImageTag(name, src) {
} }
function assembleFallbackImageSrc(inputName) { function assembleFallbackImageSrc(inputName) {
let name = Object.prototype.hasOwnProperty.call(emojiAliases, inputName) ? let name = normalizeEmojiName(inputName);
emojiAliases[inputName] : inputName;
let emojiInfo = emojiMap[name]; let emojiInfo = emojiMap[name];
// Fallback to question mark for unknown emojis // Fallback to question mark for unknown emojis
if (!emojiInfo) { if (!emojiInfo) {
...@@ -25,8 +24,7 @@ function assembleFallbackImageSrc(inputName) { ...@@ -25,8 +24,7 @@ function assembleFallbackImageSrc(inputName) {
function glEmojiTag(inputName, options) { function glEmojiTag(inputName, options) {
const opts = { sprite: false, forceFallback: false, ...options }; const opts = { sprite: false, forceFallback: false, ...options };
let name = Object.prototype.hasOwnProperty.call(emojiAliases, inputName) ? let name = normalizeEmojiName(inputName);
emojiAliases[inputName] : inputName;
let emojiInfo = emojiMap[name]; let emojiInfo = emojiMap[name];
// Fallback to question mark for unknown emojis // Fallback to question mark for unknown emojis
if (!emojiInfo) { if (!emojiInfo) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment