article-extractor icon indicating copy to clipboard operation
article-extractor copied to clipboard

Incorrect resolution when there are multiple Open Graph tags

Open SeriousBug opened this issue 9 months ago • 3 comments

The Open Graph protocol states that if there are multiple tags, the first one should be preferred in cases of conflicts. See here: https://ogp.me/#array

But article-extractor prefers the last tag. The code gets all the meta tags in the page, and iterates over them. If there are multiple tags, the last one will override earlier ones: https://github.com/extractus/article-extractor/blob/main/src/utils/extractMetaData.js#L98-L127

SeriousBug avatar Sep 27 '23 17:09 SeriousBug