]> cat aescling's git repositories - mastodon.git/commitdiff
Fix rendering of emoji in public pages
authorThibaut Girka <thib@sitedethib.com>
Tue, 18 Jun 2019 17:54:36 +0000 (19:54 +0200)
committerThibG <thib@sitedethib.com>
Tue, 18 Jun 2019 18:14:08 +0000 (20:14 +0200)
app/lib/formatter.rb

index 8a2828bbf10877fae1d045afc48e57e18099f4c6..4c11ca2914e99acd1635757d0f20b4d06770559c 100644 (file)
@@ -59,11 +59,10 @@ class Formatter
     html = "RT @#{prepend_reblog} #{html}" if prepend_reblog
     html = format_markdown(html) if status.content_type == 'text/markdown'
     html = encode_and_link_urls(html, linkable_accounts, keep_html: %w(text/markdown text/html).include?(status.content_type))
+    html = reformat(html) if %w(text/markdown text/html).include?(status.content_type)
     html = encode_custom_emojis(html, status.emojis, options[:autoplay]) if options[:custom_emojify]
 
-    if %w(text/markdown text/html).include?(status.content_type)
-      html = reformat(html)
-    else
+    unless %w(text/markdown text/html).include?(status.content_type)
       html = simple_format(html, {}, sanitize: false)
       html = html.delete("\n")
     end