Comparing version 6.0.0 to 7.0.0
@@ -0,1 +1,10 @@ | ||
# 7.0.0 / 2019-11-27 | ||
* Breaking: requires node 10+ | ||
* Please see changes in web-resource-inliner@6 for other details | ||
# 6.0.0 / 2019-11-27 | ||
* Drop support for Node.js 4 | ||
# 5.2.0 / 2019-03-18 | ||
@@ -2,0 +11,0 @@ |
@@ -62,3 +62,3 @@ 'use strict'; | ||
function inlineExternal(html, inlineOptions, callback) { | ||
var options = utils.extend({fileContent: html}, inlineOptions); | ||
var options = Object.assign({fileContent: html}, inlineOptions); | ||
inline.html(options, callback); | ||
@@ -65,0 +65,0 @@ } |
@@ -63,5 +63,4 @@ // Type definitions for Juice 3.0.0 | ||
rebaseRelativeTo?: string; | ||
cssmin?: boolean; | ||
strict?: boolean; | ||
} | ||
} |
@@ -10,5 +10,5 @@ 'use strict'; | ||
var cheerioLoad = function(html, options, encodeEntities) { | ||
options = utils.extend({decodeEntities: false}, options || {}); | ||
options = Object.assign({decodeEntities: false, _useHtmlParser2:true}, options); | ||
html = encodeEntities(html); | ||
return cheerio.load(html,options); | ||
return cheerio.load(html, options); | ||
}; | ||
@@ -15,0 +15,0 @@ |
@@ -112,12 +112,2 @@ 'use strict'; | ||
def: 'see docs for web-resource-inliner rebaseRelativeTo' }, | ||
'web-resources-cssmin': { | ||
pMap: 'webResourcesCssmin', | ||
map: 'cssmin', | ||
def: 'see docs for web-resource-inliner cssmin', | ||
coercion: JSON.parse }, | ||
'web-resources-uglify': { | ||
pMap: 'webResourcesUglify', | ||
map: 'uglify', | ||
def: 'see docs for web-resource-inliner uglify', | ||
coercion: JSON.parse }, | ||
'web-resources-strict': { | ||
@@ -124,0 +114,0 @@ pMap: 'webResourcesStrict', |
@@ -82,2 +82,7 @@ 'use strict'; | ||
var parsedSelector = selector.parsed(); | ||
if (!parsedSelector) { | ||
return; | ||
} | ||
var pseudoElementType = getPseudoElementType(parsedSelector); | ||
@@ -343,4 +348,10 @@ | ||
styleElement = this; | ||
styleDataList = styleElement.childNodes; | ||
// 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; | ||
if (styleDataList.length !== 1) { | ||
if (options.removeStyleTags) { | ||
$(styleElement).remove(); | ||
} | ||
return; | ||
@@ -353,3 +364,4 @@ } | ||
if (options.removeStyleTags && $(styleElement).attr('data-embed') === undefined) { | ||
var preservedText = utils.getPreservedText(styleElement.childNodes[0].nodeValue, { | ||
var text = usingParse5 ? styleElement.childNodes[0].nodeValue : styleElement.children[0].data; | ||
var preservedText = utils.getPreservedText(text, { | ||
mediaQueries: options.preserveMediaQueries, | ||
@@ -361,3 +373,7 @@ fontFaces: options.preserveFontFaces, | ||
if (preservedText) { | ||
styleElement.childNodes[0].nodeValue = preservedText; | ||
if (usingParse5) { | ||
styleElement.childNodes[0].nodeValue = preservedText; | ||
} else { | ||
styleElement.children[0].data = preservedText; | ||
} | ||
} else { | ||
@@ -364,0 +380,0 @@ $(styleElement).remove(); |
@@ -8,3 +8,2 @@ 'use strict'; | ||
var mensch = require('mensch'); | ||
var own = {}.hasOwnProperty; | ||
var Selector = require('./selector'); | ||
@@ -150,13 +149,4 @@ var Property = require('./property'); | ||
exports.extend = function(obj, src) { | ||
for (var key in src) { | ||
if (own.call(src, key)) { | ||
obj[key] = src[key]; | ||
} | ||
} | ||
return obj; | ||
}; | ||
exports.getDefaultOptions = function(options) { | ||
var result = exports.extend({ | ||
var result = Object.assign({ | ||
extraCss: '', | ||
@@ -163,0 +153,0 @@ insertPreservedExtraCss: true, |
{ | ||
"name": "juice", | ||
"version": "6.0.0", | ||
"version": "7.0.0", | ||
"description": "Inlines css into html source", | ||
@@ -8,2 +8,10 @@ "bin": "bin/juice", | ||
"browser": "client.js", | ||
"types": "juice.d.ts", | ||
"files": [ | ||
"bin", | ||
"lib", | ||
"client.js", | ||
"index.js", | ||
"juice.d.ts" | ||
], | ||
"scripts": { | ||
@@ -28,13 +36,10 @@ "test": "mocha --reporter spec && npm run test-typescript", | ||
"engines": { | ||
"node": ">=6.17.1" | ||
"node": ">=10.0.0" | ||
}, | ||
"types": "juice.d.ts", | ||
"dependencies": { | ||
"cheerio": "^0.22.0", | ||
"commander": "^2.15.1", | ||
"cross-spawn": "^6.0.5", | ||
"deep-extend": "^0.6.0", | ||
"cheerio": "^1.0.0-rc.3", | ||
"commander": "^5.1.0", | ||
"mensch": "^0.3.4", | ||
"slick": "^1.12.2", | ||
"web-resource-inliner": "^4.3.3" | ||
"web-resource-inliner": "^5.0.0" | ||
}, | ||
@@ -44,5 +49,6 @@ "devDependencies": { | ||
"browserify": "^16.2.3", | ||
"cross-spawn": "^6.0.5", | ||
"mocha": "^5.2.0", | ||
"should": "^11.1.1", | ||
"typescript": "^2.9.1" | ||
"typescript": "^3.9.6" | ||
}, | ||
@@ -49,0 +55,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
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
5
52655
6
13
943
+ Addedansi-colors@4.1.3(transitive)
+ Addedcheerio@1.0.0(transitive)
+ Addedcheerio-select@2.1.0(transitive)
+ Addedcommander@5.1.0(transitive)
+ Addedcss-select@5.1.0(transitive)
+ Addedcss-what@6.1.0(transitive)
+ Addeddom-serializer@2.0.0(transitive)
+ Addeddomhandler@5.0.3(transitive)
+ Addeddomutils@3.1.0(transitive)
+ Addedencoding-sniffer@0.2.0(transitive)
+ Addedentities@4.5.0(transitive)
+ Addedescape-goat@3.0.0(transitive)
+ Addedhtmlparser2@9.1.0(transitive)
+ Addediconv-lite@0.6.3(transitive)
+ Addedmime@2.6.0(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addednth-check@2.1.1(transitive)
+ Addedparse5@7.2.1(transitive)
+ Addedparse5-htmlparser2-tree-adapter@7.1.0(transitive)
+ Addedparse5-parser-stream@7.1.2(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedundici@6.20.1(transitive)
+ Addedvalid-data-url@3.0.1(transitive)
+ Addedweb-resource-inliner@5.0.0(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-encoding@3.1.1(transitive)
+ Addedwhatwg-mimetype@4.0.0(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
- Removedcross-spawn@^6.0.5
- Removeddeep-extend@^0.6.0
- Removedajv@6.12.6(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedasn1@0.2.6(transitive)
- Removedassert-plus@1.0.0(transitive)
- Removedasync@3.2.6(transitive)
- Removedasynckit@0.4.0(transitive)
- Removedaws-sign2@0.7.0(transitive)
- Removedaws4@1.13.2(transitive)
- Removedbcrypt-pbkdf@1.0.2(transitive)
- Removedcaseless@0.12.0(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcheerio@0.22.0(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedcombined-stream@1.0.8(transitive)
- Removedcommander@2.20.3(transitive)
- Removedcore-util-is@1.0.2(transitive)
- Removedcross-spawn@6.0.5(transitive)
- Removedcss-select@1.2.0(transitive)
- Removedcss-what@2.1.3(transitive)
- Removeddashdash@1.14.1(transitive)
- Removeddatauri@2.0.0(transitive)
- Removeddeep-extend@0.6.0(transitive)
- Removeddelayed-stream@1.0.0(transitive)
- Removeddom-serializer@0.1.1(transitive)
- Removeddomelementtype@1.3.1(transitive)
- Removeddomhandler@2.4.2(transitive)
- Removeddomutils@1.5.1(transitive)
- Removedecc-jsbn@0.1.2(transitive)
- Removedentities@1.1.2(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedextend@3.0.2(transitive)
- Removedextsprintf@1.3.0(transitive)
- Removedfast-deep-equal@3.1.3(transitive)
- Removedfast-json-stable-stringify@2.1.0(transitive)
- Removedforever-agent@0.6.1(transitive)
- Removedform-data@2.3.3(transitive)
- Removedgetpass@0.1.7(transitive)
- Removedhar-schema@2.0.0(transitive)
- Removedhar-validator@5.1.5(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedhtmlparser2@3.10.1(transitive)
- Removedhttp-signature@1.2.0(transitive)
- Removedimage-size@0.7.5(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-typedarray@1.0.0(transitive)
- Removedisexe@2.0.0(transitive)
- Removedisstream@0.1.2(transitive)
- Removedjsbn@0.1.1(transitive)
- Removedjson-schema@0.4.0(transitive)
- Removedjson-schema-traverse@0.4.1(transitive)
- Removedjson-stringify-safe@5.0.1(transitive)
- Removedjsprim@1.4.2(transitive)
- Removedlodash.assignin@4.2.0(transitive)
- Removedlodash.bind@4.2.1(transitive)
- Removedlodash.defaults@4.2.0(transitive)
- Removedlodash.filter@4.6.0(transitive)
- Removedlodash.flatten@4.4.0(transitive)
- Removedlodash.foreach@4.5.0(transitive)
- Removedlodash.map@4.6.0(transitive)
- Removedlodash.merge@4.6.2(transitive)
- Removedlodash.pick@4.4.0(transitive)
- Removedlodash.reduce@4.6.0(transitive)
- Removedlodash.reject@4.6.0(transitive)
- Removedlodash.some@4.6.0(transitive)
- Removedlodash.unescape@4.0.1(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedmimer@1.1.1(transitive)
- Removednice-try@1.0.5(transitive)
- Removednth-check@1.0.2(transitive)
- Removedoauth-sign@0.9.0(transitive)
- Removedpath-key@2.0.1(transitive)
- Removedperformance-now@2.1.0(transitive)
- Removedpsl@1.9.0(transitive)
- Removedpunycode@2.3.1(transitive)
- Removedqs@6.5.3(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedrequest@2.88.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsemver@5.7.2(transitive)
- Removedshebang-command@1.2.0(transitive)
- Removedshebang-regex@1.0.0(transitive)
- Removedsshpk@1.18.0(transitive)
- Removedstring_decoder@1.3.0(transitive)
- Removedsupports-color@5.5.0(transitive)
- Removedtough-cookie@2.5.0(transitive)
- Removedtunnel-agent@0.6.0(transitive)
- Removedtweetnacl@0.14.5(transitive)
- Removeduri-js@4.4.1(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removeduuid@3.4.0(transitive)
- Removedvalid-data-url@2.0.0(transitive)
- Removedverror@1.10.0(transitive)
- Removedweb-resource-inliner@4.3.4(transitive)
- Removedwhich@1.3.1(transitive)
- Removedxtend@4.0.2(transitive)
Updatedcheerio@^1.0.0-rc.3
Updatedcommander@^5.1.0
Updatedweb-resource-inliner@^5.0.0