diff --git a/app/services/fetch_link_card_service.rb b/app/services/fetch_link_card_service.rb index 5440ae1323..42c2da4637 100644 --- a/app/services/fetch_link_card_service.rb +++ b/app/services/fetch_link_card_service.rb @@ -83,9 +83,9 @@ class FetchLinkCardService < BaseService else document = Nokogiri::HTML(@status.text) links = document.css(':not(.quote-inline) > a') - - links.filter_map { |a| Addressable::URI.parse(a['href']) unless skip_link?(a) }.filter_map(&:normalize) - end + links.filter_map { |a| Addressable::URI.parse(a['href']) unless skip_link?(a) }.filter_map(&:normalize) + end + end urls.reject { |uri| bad_url?(uri) }.first end