]> cat aescling's git repositories - mastodon.git/commitdiff
microformat mentions can have an implicit property (#12189)
authornightpool <nightpool@users.noreply.github.com>
Thu, 24 Oct 2019 20:46:15 +0000 (16:46 -0400)
committerEugen Rochko <eugen@zeonfederated.com>
Thu, 24 Oct 2019 20:46:15 +0000 (22:46 +0200)
See the first example here: http://microformats.org/wiki/microformats2#hyperlinked_person

app/services/fetch_link_card_service.rb

index f0b1169db8516ebf17a21b4df2e3e764a1bab4f2..640c60fd473efc1c4314fe2b1bcc842b82a63abe 100644 (file)
@@ -84,7 +84,7 @@ class FetchLinkCardService < BaseService
 
   def skip_link?(a)
     # Avoid links for hashtags and mentions (microformats)
-    a['rel']&.include?('tag') || a['class']&.include?('u-url') || mention_link?(a)
+    a['rel']&.include?('tag') || a['class']&.match?(/u-url|h-card/) || mention_link?(a)
   end
 
   def attempt_oembed