about summary refs log tree commit diff
path: root/app/javascript/mastodon/actions/importer/normalizer.js
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-03-06 03:57:46 +0100
committerGitHub <noreply@github.com>2019-03-06 03:57:46 +0100
commit4407f07014096bcbaf5a06015a5791984282846d (patch)
tree56be6d068c123835ab733fd0c69c23b4d36bb8e7 /app/javascript/mastodon/actions/importer/normalizer.js
parentefd0fb80880171b1f027b6d0dbd8ace999857062 (diff)
Render unicode emoji in polls using emoji pack (#10185)
Diffstat (limited to 'app/javascript/mastodon/actions/importer/normalizer.js')
-rw-r--r--app/javascript/mastodon/actions/importer/normalizer.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/javascript/mastodon/actions/importer/normalizer.js b/app/javascript/mastodon/actions/importer/normalizer.js
index 3085cd537..ea80c0efb 100644
--- a/app/javascript/mastodon/actions/importer/normalizer.js
+++ b/app/javascript/mastodon/actions/importer/normalizer.js
@@ -67,3 +67,14 @@ export function normalizeStatus(status, normalOldStatus) {
 
   return normalStatus;
 }
+
+export function normalizePoll(poll) {
+  const normalPoll = { ...poll };
+
+  normalPoll.options = poll.options.map(option => ({
+    ...option,
+    title_emojified: emojify(escapeTextContentForBrowser(option.title)),
+  }));
+
+  return normalPoll;
+}