Merge remote-tracking branch 'parent/stable-4.3' into kb-draft-15.12-lts

This commit is contained in:
KMY 2025-04-03 06:38:45 +09:00
commit 97647cbbc0
108 changed files with 1729 additions and 1018 deletions

View file

@ -2,11 +2,18 @@
module Admin::Trends::StatusesHelper
def one_line_preview(status)
text = if status.local?
status.text.split("\n").first
else
Nokogiri::HTML5(status.text).css('html > body > *').first&.text
end
text = begin
if status.local?
status.text.split("\n").first
else
Nokogiri::HTML5(status.text).css('html > body > *').first&.text
end
rescue ArgumentError
# This can happen if one of the Nokogumbo limits is encountered
# Unfortunately, it does not use a more precise error class
# nor allows more graceful handling
''
end
return '' if text.blank?