Skye 2 years ago
parent b741837ef2
commit fc13bfb6f6
Signed by: me
GPG Key ID: 0104BC05F41B77B8

@ -83,9 +83,9 @@ class FetchLinkCardService < BaseService
else else
document = Nokogiri::HTML(@status.text) document = Nokogiri::HTML(@status.text)
links = document.css(':not(.quote-inline) > a') links = document.css(':not(.quote-inline) > a')
links.filter_map { |a| Addressable::URI.parse(a['href']) unless skip_link?(a) }.filter_map(&:normalize)
links.filter_map { |a| Addressable::URI.parse(a['href']) unless skip_link?(a) }.filter_map(&:normalize) end
end end
urls.reject { |uri| bad_url?(uri) }.first urls.reject { |uri| bad_url?(uri) }.first
end end

Loading…
Cancel
Save