replace emojiAlias references with normalizeEmojiName helper

This commit is contained in:
Mike Greiling 2017-06-26 17:05:43 -05:00
parent 82d67f700e
commit 527e7edbc4

View file

@ -1,5 +1,5 @@
import installCustomElements from 'document-register-element';
import { emojiMap, emojiAliases, isEmojiUnicodeSupported, getUnicodeSupportMap } from '../emoji';
import { emojiMap, normalizeEmojiName, isEmojiUnicodeSupported, getUnicodeSupportMap } from '../emoji';
installCustomElements(window);
@ -10,8 +10,7 @@ function emojiImageTag(name, src) {
}
function assembleFallbackImageSrc(inputName) {
let name = Object.prototype.hasOwnProperty.call(emojiAliases, inputName) ?
emojiAliases[inputName] : inputName;
let name = normalizeEmojiName(inputName);
let emojiInfo = emojiMap[name];
// Fallback to question mark for unknown emojis
if (!emojiInfo) {
@ -25,8 +24,7 @@ function assembleFallbackImageSrc(inputName) {
function glEmojiTag(inputName, options) {
const opts = { sprite: false, forceFallback: false, ...options };
let name = Object.prototype.hasOwnProperty.call(emojiAliases, inputName) ?
emojiAliases[inputName] : inputName;
let name = normalizeEmojiName(inputName);
let emojiInfo = emojiMap[name];
// Fallback to question mark for unknown emojis
if (!emojiInfo) {