From a28f04326ad8941b2fea32727238bd30b93aa129 Mon Sep 17 00:00:00 2001 From: Jakob Krigovsky Date: Fri, 26 May 2017 10:09:42 +0200 Subject: [PATCH] Add support for custom emojis to sanitize() --- src/utils/index.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/utils/index.js b/src/utils/index.js index 6fd684b..4c436ec 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -15,10 +15,21 @@ function unifiedToNative(unified) { } function sanitize(emoji) { - var { name, short_names, skin_tone, skin_variations, emoticons, unified } = emoji, + var { name, short_names, skin_tone, skin_variations, emoticons, unified, custom, imageUrl } = emoji, id = short_names[0], colons = `:${id}:` + if (custom) { + return { + id, + name, + colons, + emoticons, + custom, + imageUrl + } + } + if (skin_tone) { colons += `:skin-tone-${skin_tone}:` }