mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
cefa526c6d
* Refactor formatter * Move custom emoji pre-rendering logic to view helpers * Move more methods out of Formatter * Fix code style issues * Remove Formatter * Add inline poll options to RSS feeds * Remove unused helper method * Fix code style issues * Various fixes and improvements * Fix test
17 lines
370 B
Ruby
17 lines
370 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Admin::Trends::StatusesHelper
|
|
def one_line_preview(status)
|
|
text = begin
|
|
if status.local?
|
|
status.text.split("\n").first
|
|
else
|
|
Nokogiri::HTML(status.text).css('html > body > *').first&.text
|
|
end
|
|
end
|
|
|
|
return '' if text.blank?
|
|
|
|
prerender_custom_emojis(h(text), status.emojis)
|
|
end
|
|
end
|