Fix: 投稿ではないリンクを参照したときにリンクプレビューが生成されない問題 (#482)
This commit is contained in:
parent
6aede85a2d
commit
46161e5348
2 changed files with 48 additions and 5 deletions
|
@ -88,6 +88,10 @@ class FetchLinkCardService < BaseService
|
|||
end
|
||||
|
||||
def referenced_urls
|
||||
referenced_urls_raw.filter { |uri| ActivityPub::TagManager.instance.uri_to_resource(uri, Status, url: true).present? }
|
||||
end
|
||||
|
||||
def referenced_urls_raw
|
||||
unless @status.local?
|
||||
document = Nokogiri::HTML(@status.text)
|
||||
document.search('a[href^="http://"]', 'a[href^="https://"]').each do |link|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue