about summary refs log tree commit diff
path: root/app/lib/formatter.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-03-20 17:29:12 +0100
committerEugen Rochko <eugen@zeonfederated.com>2019-03-20 17:29:12 +0100
commit80f0910e2141b24082b9143266a9a6cf1ef6a516 (patch)
treeaf7a96def3f54cdb4b8fcb11adc1ecb36166c529 /app/lib/formatter.rb
parent66d945209278c9344d503fe4e7a58d5c6f040e50 (diff)
Add support for custom emojis in poll options (#10322)
* Backend changes for custom emoji support in poll options

* Serialize poll emojis in REST API

* Render custom emojis in poll options

* Render custom emoji in poll options on public pages
Diffstat (limited to 'app/lib/formatter.rb')
-rw-r--r--app/lib/formatter.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb
index 464e1ee7e..aadf03b2a 100644
--- a/app/lib/formatter.rb
+++ b/app/lib/formatter.rb
@@ -71,6 +71,12 @@ class Formatter
     html.html_safe # rubocop:disable Rails/OutputSafety
   end
 
+  def format_poll_option(status, option, **options)
+    html = encode(option.title)
+    html = encode_custom_emojis(html, status.emojis, options[:autoplay])
+    html.html_safe # rubocop:disable Rails/OutputSafety
+  end
+
   def format_display_name(account, **options)
     html = encode(account.display_name.presence || account.username)
     html = encode_custom_emojis(html, account.emojis, options[:autoplay]) if options[:custom_emojify]