From 55e0eb52cef3b6895cf39c70e033567137d5850b Mon Sep 17 00:00:00 2001
From: Dessalines <tyhou13@gmx.com>
Date: Sun, 21 Feb 2021 16:22:53 -0500
Subject: [PATCH] Using utf-8 emojis. Fixes #184

---
 package.json        | 1 -
 src/shared/utils.ts | 6 +-----
 yarn.lock           | 5 -----
 3 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/package.json b/package.json
index 8f35d4b..4b3426f 100644
--- a/package.json
+++ b/package.json
@@ -32,7 +32,6 @@
     "jwt-decode": "^3.1.2",
     "markdown-it": "^12.0.4",
     "markdown-it-container": "^3.0.0",
-    "markdown-it-emoji": "^2.0.0",
     "markdown-it-sub": "^1.0.0",
     "markdown-it-sup": "^1.0.0",
     "moment": "^2.29.1",
diff --git a/src/shared/utils.ts b/src/shared/utils.ts
index 016862f..febb472 100644
--- a/src/shared/utils.ts
+++ b/src/shared/utils.ts
@@ -61,7 +61,6 @@ if (isBrowser()) {
 import markdown_it from 'markdown-it';
 import markdown_it_sub from 'markdown-it-sub';
 import markdown_it_sup from 'markdown-it-sup';
-import markdownitEmoji from 'markdown-it-emoji/light';
 import markdown_it_container from 'markdown-it-container';
 import emojiShortName from 'emoji-short-name';
 import Toastify from 'toastify-js';
@@ -201,9 +200,6 @@ export const md = new markdown_it({
         return '</details>\n';
       }
     },
-  })
-  .use(markdownitEmoji, {
-    defs: objectFlip(emojiShortName),
   });
 
 export function hotRankComment(comment_view: CommentView): number {
@@ -661,7 +657,7 @@ export function setupTribute() {
           return `${item.original.val} ${shortName}`;
         },
         selectTemplate: (item: any) => {
-          return `:${item.original.key}:`;
+          return `${item.original.val}`;
         },
         values: Object.entries(emojiShortName).map(e => {
           return { key: e[1], val: e[0] };
diff --git a/yarn.lock b/yarn.lock
index 6628f67..f698b36 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5974,11 +5974,6 @@ markdown-it-container@^3.0.0:
   resolved "https://registry.yarnpkg.com/markdown-it-container/-/markdown-it-container-3.0.0.tgz#1d19b06040a020f9a827577bb7dbf67aa5de9a5b"
   integrity sha512-y6oKTq4BB9OQuY/KLfk/O3ysFhB3IMYoIWhGJEidXt1NQFocFK2sA2t0NYZAMyMShAGL6x5OPIbrmXPIqaN9rw==
 
-markdown-it-emoji@^2.0.0:
-  version "2.0.0"
-  resolved "https://registry.yarnpkg.com/markdown-it-emoji/-/markdown-it-emoji-2.0.0.tgz#3164ad4c009efd946e98274f7562ad611089a231"
-  integrity sha512-39j7/9vP/CPCKbEI44oV8yoPJTpvfeReTn/COgRhSpNrjWF3PfP/JUxxB0hxV6ynOY8KH8Y8aX9NMDdo6z+6YQ==
-
 markdown-it-sub@^1.0.0:
   version "1.0.0"
   resolved "https://registry.yarnpkg.com/markdown-it-sub/-/markdown-it-sub-1.0.0.tgz#375fd6026eae7ddcb012497f6411195ea1e3afe8"
-- 
2.44.1