fix: jquery doesn't like the case insensitive selector (#274)

pull/275/head
Adam Pash 5 years ago committed by GitHub
parent 9bf88b0ba3
commit 2afd8c9fa8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -66,8 +66,11 @@ const Resource = {
let $ = cheerio.load(decodedContent);
// after first cheerio.load, check to see if encoding matches
const contentTypeSelector = cheerio.browser
? 'meta[http-equiv=content-type]'
: 'meta[http-equiv=content-type i]';
const metaContentType =
$('meta[http-equiv=content-type i]').attr('content') ||
$(contentTypeSelector).attr('content') ||
$('meta[charset]').attr('charset');
const properEncoding = getEncoding(metaContentType);

Loading…
Cancel
Save