mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
Handle meta name attribute as case-insensitive
This commit is contained in:
parent
6e134e78af
commit
ab67866ac9
2 changed files with 2 additions and 2 deletions
|
@ -245,7 +245,7 @@ class LinkDetailsExtractor
|
||||||
end
|
end
|
||||||
|
|
||||||
def meta_tag(name)
|
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
|
end
|
||||||
|
|
||||||
def structured_data
|
def structured_data
|
||||||
|
|
|
@ -41,7 +41,7 @@ RSpec.describe LinkDetailsExtractor do
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>Man bites dog</title>
|
<title>Man bites dog</title>
|
||||||
<meta name="description" content="A dog's tale">
|
<meta name="descripTION" content="A dog's tale">
|
||||||
<link rel="pretty IcoN" href="/favicon.ico">
|
<link rel="pretty IcoN" href="/favicon.ico">
|
||||||
</head>
|
</head>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue