fix: PARSING_NODE undefined (#172)

* fix: PARSING_NODE undefined

* chore: remove unused cleanup function/call
pull/173/head
Jeremy Mack 7 years ago committed by Adam Pash
parent a51cc81c27
commit 5fcea1c5c3

File diff suppressed because one or more lines are too long

@ -86,12 +86,6 @@ const Mercury = {
};
}
// if this parse is happening in the browser,
// clean up any trace from the page.
if (cheerio.browser) {
cheerio.cleanup();
}
return result;
},

@ -65,7 +65,7 @@ $.html = ($node) => {
const $body = removeUnusedTags($('body', null, null, false).clone());
const $head = removeUnusedTags($('head', null, null, false).clone());
if (PARSING_NODE.length > 0) {
if (PARSING_NODE && PARSING_NODE.length > 0) {
return PARSING_NODE.children().html();
}
@ -79,10 +79,6 @@ $.html = ($node) => {
return html;
};
$.cleanup = () => {
$(`.${PARSER_CLASS}`, null, null, false).remove();
};
$.load = (html, opts = {}, returnHtml = false) => {
if (!html) {
html = $.cloneHtml();

Loading…
Cancel
Save