This is a bit of a hack.
-
-
Save joepie91/aa96bfb6c21704c2819a6067a04dfef6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("noscript").each((i, tag) => { | |
/* Force the <noscript> tag contents to be interpreted as HTML, as cheerio interprets them as text by default... */ | |
let noScriptContents = $(tag).text(); | |
let parsedNoScriptContents = cheerio.load(noScriptContents); | |
$(tag).empty().append(parsedNoScriptContents("body").contents()); | |
}); |
For future reference: this was tested with cheerio 1.0.0-rc.2
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cheerio's noscript issue solution. HTML vs text