inline-css
Advanced tools
Comparing version 2.1.1 to 2.2.0
21
index.js
'use strict'; | ||
var Promise = require('bluebird'), | ||
extend = require('extend'), | ||
inlineContent = require('./lib/inlineContent'); | ||
function extend(obj, src) { | ||
var key, | ||
own = {}.hasOwnProperty; | ||
for (key in src) { | ||
if (own.call(src, key)) { | ||
obj[key] = src[key]; | ||
} | ||
} | ||
return obj; | ||
} | ||
module.exports = function (html, options) { | ||
@@ -29,3 +18,9 @@ return new Promise(function (resolve, reject) { | ||
applyWidthAttributes: false, | ||
applyTableAttributes: false | ||
applyTableAttributes: false, | ||
xmlMode: false, | ||
decodeEntities: false, | ||
lowerCaseTags: true, | ||
lowerCaseAttributeNames: false, | ||
recognizeCDATA: false, | ||
recognizeSelfClosing: false | ||
}, options); | ||
@@ -32,0 +27,0 @@ |
@@ -11,3 +11,4 @@ 'use strict'; | ||
removeClassId = require('./removeClassId'), | ||
setTableAttrs = require('./setTableAttrs'); | ||
setTableAttrs = require('./setTableAttrs'), | ||
pick = require('object.pick'); | ||
@@ -18,5 +19,10 @@ module.exports = function (html, css, options) { | ||
editedElements = [], | ||
$ = cheerio.load(html, { | ||
decodeEntities: false | ||
}); | ||
$ = cheerio.load(html, pick(opts, [ | ||
'xmlMode', | ||
'decodeEntities', | ||
'lowerCaseTags', | ||
'lowerCaseAttributeNames', | ||
'recognizeCDATA', | ||
'recognizeSelfClosing' | ||
])); | ||
@@ -23,0 +29,0 @@ rules.forEach(function (rule) { |
{ | ||
"name": "inline-css", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"description": "Inline css into an html file.", | ||
@@ -14,4 +14,6 @@ "main": "index.js", | ||
"css-rules": "^1.0.0", | ||
"extend": "^3.0.0", | ||
"extract-css": "^1.0.0", | ||
"flatten": "0.0.1", | ||
"object.pick": "^1.1.1", | ||
"style-selector": "^1.0.0" | ||
@@ -18,0 +20,0 @@ }, |
@@ -159,2 +159,6 @@ # inline-css [![npm](http://img.shields.io/npm/v/inline-css.svg?style=flat)](https://badge.fury.io/js/inline-css) [![Build Status](https://travis-ci.org/jonkemp/inline-css.svg?branch=master)](https://travis-ci.org/jonkemp/inline-css) [![Coverage Status](https://coveralls.io/repos/jonkemp/inline-css/badge.svg?branch=master&service=github)](https://coveralls.io/github/jonkemp/inline-css?branch=master) | ||
### cheerio options | ||
Options to passed to [cheerio](https://github.com/cheeriojs/cheerio). | ||
## Contributing | ||
@@ -161,0 +165,0 @@ |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
14626
300
170
0
9
+ Addedextend@^3.0.0
+ Addedobject.pick@^1.1.1
+ Addedextend@3.0.2(transitive)
+ Addedisobject@3.0.1(transitive)
+ Addedobject.pick@1.3.0(transitive)