From ab67866ac94b428ad746d11427df041dec925b4c Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Fri, 9 Aug 2024 17:05:32 +0200 Subject: [PATCH] Handle meta name attribute as case-insensitive --- app/lib/link_details_extractor.rb | 2 +- spec/lib/link_details_extractor_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/lib/link_details_extractor.rb b/app/lib/link_details_extractor.rb index bebc9c9fd72..e67be33366d 100644 --- a/app/lib/link_details_extractor.rb +++ b/app/lib/link_details_extractor.rb @@ -245,7 +245,7 @@ class LinkDetailsExtractor end def meta_tag(name) - document.xpath("//meta[@name=\"#{name}\"]").pick('content') + head.xpath('//meta[@name][@content]').find { |el| name.casecmp?(el['name']) }&.attr('content') end def structured_data diff --git a/spec/lib/link_details_extractor_spec.rb b/spec/lib/link_details_extractor_spec.rb index e7f22eddabb..d65942d9023 100644 --- a/spec/lib/link_details_extractor_spec.rb +++ b/spec/lib/link_details_extractor_spec.rb @@ -41,7 +41,7 @@ RSpec.describe LinkDetailsExtractor do Man bites dog - +