Add support for custom emojis to sanitize()
parent
2f7d6eb0d8
commit
a28f04326a
|
@ -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}:`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue