Comparing version 10.0.1 to 11.0.0
@@ -10,3 +10,4 @@ 'use strict'; | ||
var cheerioLoad = function(html, options, encodeEntities) { | ||
options = Object.assign({decodeEntities: false, _useHtmlParser2:true}, options); | ||
const { xmlMode, ...rest } = options; | ||
options = Object.assign({ xml: { decodeEntities: false, xmlMode } }, rest); | ||
html = encodeEntities(html); | ||
@@ -13,0 +14,0 @@ return cheerio.load(html, options); |
@@ -11,5 +11,6 @@ 'use strict'; | ||
cli.getProgram = function() { | ||
program.name = pkg.name; | ||
program.version(pkg.version) | ||
program | ||
.name(pkg.name) | ||
.description(pkg.description) | ||
.version(pkg.version) | ||
.usage('[options] input.html output.html'); | ||
@@ -128,3 +129,3 @@ | ||
var option = cli.options[key]; | ||
var value = program[option.pMap]; | ||
var value = program.getOptionValue(option.pMap); | ||
if (value !== undefined) { | ||
@@ -131,0 +132,0 @@ if (option.coercion) { |
@@ -254,3 +254,3 @@ 'use strict'; | ||
}); | ||
var string = props | ||
@@ -263,3 +263,3 @@ .filter(function(prop) { | ||
} | ||
// Content becomes the innerHTML of pseudo elements, not used as a | ||
@@ -474,6 +474,3 @@ // style property | ||
styleElement = this; | ||
// the API for Cheerio using parse5 (default) and htmlparser2 are slightly different | ||
// detect this by checking if .childNodes exist (as opposed to .children) | ||
var usingParse5 = !!styleElement.childNodes; | ||
styleDataList = usingParse5 ? styleElement.childNodes : styleElement.children; | ||
styleDataList = styleElement.childNodes; | ||
if (styleDataList.length !== 1) { | ||
@@ -490,3 +487,3 @@ if (options.removeStyleTags) { | ||
if (options.removeStyleTags && $(styleElement).attr('data-embed') === undefined) { | ||
var text = usingParse5 ? styleElement.childNodes[0].nodeValue : styleElement.children[0].data; | ||
var text = styleElement.childNodes[0].nodeValue; | ||
var preservedText = utils.getPreservedText(text, { | ||
@@ -499,7 +496,3 @@ mediaQueries: options.preserveMediaQueries, | ||
if (preservedText) { | ||
if (usingParse5) { | ||
styleElement.childNodes[0].nodeValue = preservedText; | ||
} else { | ||
styleElement.children[0].data = preservedText; | ||
} | ||
styleElement.childNodes[0].nodeValue = preservedText; | ||
} else { | ||
@@ -506,0 +499,0 @@ $(styleElement).remove(); |
{ | ||
"name": "juice", | ||
"version": "10.0.1", | ||
"version": "11.0.0", | ||
"description": "Inlines css into html source", | ||
@@ -35,19 +35,19 @@ "bin": "bin/juice", | ||
"engines": { | ||
"node": ">=10.0.0" | ||
"node": ">=18.17" | ||
}, | ||
"dependencies": { | ||
"cheerio": "1.0.0-rc.12", | ||
"commander": "^6.1.0", | ||
"cheerio": "^1.0.0", | ||
"commander": "^12.1.0", | ||
"mensch": "^0.3.4", | ||
"slick": "^1.12.2", | ||
"web-resource-inliner": "^6.0.1" | ||
"web-resource-inliner": "^7.0.0" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^22.2.0", | ||
"@types/node": "^22.4.2", | ||
"batch": "0.6.1", | ||
"browserify": "^17.0.0", | ||
"cross-spawn": "^7.0.3", | ||
"mocha": "^5.2.0", | ||
"mocha": "^10.7.3", | ||
"should": "^13.2.3", | ||
"typescript": "^5.0.2" | ||
"typescript": "^5.5.4" | ||
}, | ||
@@ -54,0 +54,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50541
1125
+ Addedcheerio@1.0.0(transitive)
+ Addedcommander@12.1.0(transitive)
+ Addedencoding-sniffer@0.2.0(transitive)
+ Addedhtmlparser2@9.1.0(transitive)
+ Addediconv-lite@0.6.3(transitive)
+ Addedparse5-parser-stream@7.1.2(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedundici@6.20.1(transitive)
+ Addedweb-resource-inliner@7.0.0(transitive)
+ Addedwhatwg-encoding@3.1.1(transitive)
+ Addedwhatwg-mimetype@4.0.0(transitive)
- Removedcheerio@1.0.0-rc.12(transitive)
- Removedcommander@6.2.1(transitive)
- Removedhtmlparser2@8.0.2(transitive)
- Removednode-fetch@2.7.0(transitive)
- Removedtr46@0.0.3(transitive)
- Removedweb-resource-inliner@6.0.1(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)
Updatedcheerio@^1.0.0
Updatedcommander@^12.1.0
Updatedweb-resource-inliner@^7.0.0