From a0c70b1e93501a9e7c91cf309157707e72e972d2 Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Sun, 14 Mar 2021 12:45:44 +0100 Subject: [PATCH] Add postprocessing attributes editions for twemojis #183 --- source/app/metrics/utils.mjs | 4 +++- source/templates/classic/partials/reactions.ejs | 12 ++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/source/app/metrics/utils.mjs b/source/app/metrics/utils.mjs index ea8a3663..d071c046 100644 --- a/source/app/metrics/utils.mjs +++ b/source/app/metrics/utils.mjs @@ -213,8 +213,10 @@ emojis.set(emoji, (await axios.get(url)).data.replace(/^[^>]*)>${emoji}`, "g"), twemoji.replace('')) rendered = rendered.replace(new RegExp(emoji, "g"), twemoji) + } return rendered }, /**Render github emojis */ diff --git a/source/templates/classic/partials/reactions.ejs b/source/templates/classic/partials/reactions.ejs index 7995ffcf..888ca925 100644 --- a/source/templates/classic/partials/reactions.ejs +++ b/source/templates/classic/partials/reactions.ejs @@ -13,14 +13,6 @@ <% } else { %>
- <% if (plugins.reactions.twemoji) { %> - - <% } %>
<% for (const [reaction, icon] of Object.entries({HEART:"❤️", THUMBS_UP:"👍", THUMBS_DOWN:"👎", LAUGH:"😄", CONFUSED:"😕", EYES:"👀", ROCKET:"🚀", HOORAY:"🎉"})) { const {score = 0, value:count = 0} = plugins.reactions.list[reaction] ?? {} %>
@@ -29,13 +21,13 @@ <% if (score > 0) { %> <% if (plugins.reactions.twemoji) { %> - <%= icon %> + <%= icon %> <% } else { %> <%= icon %> <% } %> <% } else { %> <% if (plugins.reactions.twemoji) { %> - <%= icon %> + <%= icon %> <% } else { %> <%= icon %> <% } %>