From ad7c7ffa66f8e2fb64155c907d95a9fcf35e0bda Mon Sep 17 00:00:00 2001 From: Cutls Date: Fri, 3 May 2019 00:51:10 +0900 Subject: [PATCH] Fix: flag emojis #64 --- app/js/emoji/default-emoji.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/js/emoji/default-emoji.js b/app/js/emoji/default-emoji.js index 8c227803..3ec3019a 100644 --- a/app/js/emoji/default-emoji.js +++ b/app/js/emoji/default-emoji.js @@ -54,7 +54,13 @@ function defEmoji(target){ var emojiraw = newpack.filter(function(item, index){ if (item.short_name == target) return true; }); - emoji=twemoji.convert.fromCodePoint(emojiraw[0].unified); + var hex=emojiraw[0].unified.split("-"); + if(hex.length===2){ + emoji=twemoji.convert.fromCodePoint(hex[0])+twemoji.convert.fromCodePoint(hex[1]); + }else{ + emoji=twemoji.convert.fromCodePoint(hex[0]); + } + console.log(emoji) var now = $("#textarea").val(); var selin = localStorage.getItem("cursor"); var now = $("#textarea").val();