Skip to content

Instantly share code, notes, and snippets.

@joepie91 joepie91/1.md
Last active Mar 19, 2018

Embed
What would you like to do?

This is a bit of a hack.

$("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());
});
@cthulchu

This comment has been minimized.

Copy link

cthulchu commented Mar 19, 2018

cheerio's noscript issue solution. HTML vs text

@joepie91

This comment has been minimized.

Copy link
Owner Author

joepie91 commented Mar 19, 2018

For future reference: this was tested with cheerio 1.0.0-rc.2.

@joepie91

This comment has been minimized.

Copy link
Owner Author

joepie91 commented Mar 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.