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
This commit is contained in:
ThibG 2019-03-20 17:29:12 +01:00 committed by Eugen Rochko
parent 66d9452092
commit 80f0910e21
9 changed files with 35 additions and 7 deletions

View file

@ -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]