diff --git a/src/resource/index.js b/src/resource/index.js index 66c853c2..b864f636 100644 --- a/src/resource/index.js +++ b/src/resource/index.js @@ -51,7 +51,7 @@ const Resource = { throw new Error('Content does not appear to be text.'); } - let $ = cheerio.load(content, { normalizeWhitespace: true }); + let $ = cheerio.load(content); if ($.root().children().length === 0) { throw new Error('No children, likely a bad parse.'); diff --git a/src/shims/cheerio-query.js b/src/shims/cheerio-query.js index 4d02da51..a7d5fcb4 100644 --- a/src/shims/cheerio-query.js +++ b/src/shims/cheerio-query.js @@ -84,17 +84,9 @@ $.cleanup = () => { }; $.load = (html, opts = {}, returnHtml = false) => { - const { normalizeWhitespace } = opts; - if (!html) { html = $.cloneHtml(); } else { - if (normalizeWhitespace) { - if (typeof html === 'string') { - html = html.replace(/[\s\n\r]+/g, ' '); - } - } - html = $('').html(html); }