Skip to content

Commit

Permalink
Update app/helpers/admin/trends/statuses_helper.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
Ember-ruby committed Apr 28, 2024
1 parent efb5552 commit 11b96a1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/helpers/admin/trends/statuses_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# frozen_string_literal: true

Check warning on line 3 in app/helpers/admin/trends/statuses_helper.rb

View workflow job for this annotation

GitHub Actions / lint

[Correctable] Lint/DuplicateMagicComment: Duplicate magic comment detected.

module Admin::Trends::StatusesHelper
def one_line_preview(status)
text = if status.local?
Expand All @@ -12,4 +14,16 @@ def one_line_preview(status)

prerender_custom_emojis(h(text), status.emojis)
end

Check failure on line 17 in app/helpers/admin/trends/statuses_helper.rb

View workflow job for this annotation

GitHub Actions / lint

[Correctable] Layout/TrailingWhitespace: Trailing whitespace detected. (https://rubystyle.guide#no-trailing-whitespace)
def multi_line_preview(status)
text = if status.local?
status.text.split("\n")
else
Nokogiri::HTML(status.text).css('html > body > *')&.text
end

return '' if text.blank?

prerender_custom_emojis(h(text), status.emojis)
end
end

0 comments on commit 11b96a1

Please sign in to comment.