From 65548359cc5c78455b638c5be6fdec3e321e717a Mon Sep 17 00:00:00 2001
From: 6543 <6543@obermui.de>
Date: Tue, 29 Jun 2021 16:28:38 +0200
Subject: Add custom emoji support (#16004)
---
web_src/js/features/emoji.js | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
(limited to 'web_src/js')
diff --git a/web_src/js/features/emoji.js b/web_src/js/features/emoji.js
index 7a522b95fc..254a0b5c4d 100644
--- a/web_src/js/features/emoji.js
+++ b/web_src/js/features/emoji.js
@@ -1,8 +1,9 @@
import emojis from '../../../assets/emoji.json';
const {AssetUrlPrefix} = window.config;
+const {CustomEmojis} = window.config;
-const tempMap = {gitea: ':gitea:'};
+const tempMap = {...CustomEmojis};
for (const {emoji, aliases} of emojis) {
for (const alias of aliases || []) {
tempMap[alias] = emoji;
@@ -23,8 +24,8 @@ for (const key of emojiKeys) {
// retrieve HTML for given emoji name
export function emojiHTML(name) {
let inner;
- if (name === 'gitea') {
- inner = `
`;
+ if (Object.prototype.hasOwnProperty.call(CustomEmojis, name)) {
+ inner = `
`;
} else {
inner = emojiString(name);
}
--
cgit v1.2.3