th: services: link fetcher: do not fetch links for quotes

This commit is contained in:
Ariadne Conill 2022-12-25 02:00:29 +00:00
parent 071f00d92d
commit 05d613083f

View file

@ -74,7 +74,7 @@ class FetchLinkCardService < BaseService
@status.text.scan(URL_PATTERN).map { |array| Addressable::URI.parse(array[1]).normalize }
else
document = Nokogiri::HTML(@status.text)
links = document.css('a')
links = document.css(':not(.quote-inline) > a')
links.filter_map { |a| Addressable::URI.parse(a['href']) unless skip_link?(a) }.filter_map(&:normalize)
end