diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/lib/formatter.rb | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb index dec60a3ea..513b85fc3 100644 --- a/app/lib/formatter.rb +++ b/app/lib/formatter.rb @@ -52,13 +52,7 @@ class Formatter end return '' if raw_content.blank? - - unless status.local? - html = reformat(raw_content) - html = encode_custom_emojis(html, status.emojis, options[:autoplay]) if options[:custom_emojify] - html = format_article_content(summary, html) if options[:article_content] && summary.present? - return html.html_safe # rubocop:disable Rails/OutputSafety - end + return format_remote_content(raw_content, status.emojis, summary: summary, **options) unless status.local? linkable_accounts = status.active_mentions.map(&:account) linkable_accounts << status.account @@ -80,6 +74,13 @@ class Formatter html.html_safe # rubocop:disable Rails/OutputSafety end + def format_remote_content(html, emojis, **options) + html = reformat(html) + html = encode_custom_emojis(html, emojis, options[:autoplay]) if options[:custom_emojify] + html = format_article_content(options[:summary], html) if options[:article_content] && options[:summary].present? + html.html_safe # rubocop:disable Rails/OutputSafety + end + def format_markdown(html) html = markdown_formatter.render(html) html.delete("\r").delete("\n") |