New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

inlinecss

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inlinecss - npm Package Compare versions

Comparing version
1.1.2
to
1.1.3
+11
-5
index.js

@@ -81,5 +81,9 @@ var fs = require('fs'),

// Check options defaults
options.decodeEntities = (typeof options.decodeEntities == 'undefined' ? true : options.decodeEntities);
options.inlineStyleTags = (typeof options.inlineStyleTags == 'undefined' ? true : options.inlineStyleTags);
for(var prop in settings) { if(typeof options[prop] !== 'undefined') settings[prop] = options[prop]; }
$ = cheerio.load(html, { decodeEntities: false });
$ = cheerio.load(html, { decodeEntities: options.decodeEntities });

@@ -98,6 +102,8 @@ var stylesheets = [];

// Loop through embedded style tags
$('style').each(function(i, elem) {
embedStyles($(this).text());
$(this).remove();
});
if(options.inlineStyleTags) {
$('style').each(function(i, elem) {
embedStyles($(this).text());
$(this).remove();
});
}

@@ -104,0 +110,0 @@ if(settings.removeClasses == true) {

{
"name": "inlinecss",
"version": "1.1.2",
"version": "1.1.3",
"description": "Inlines stylesheets and style tags into html content",

@@ -5,0 +5,0 @@ "author": "Ripel Labs",

@@ -52,2 +52,14 @@ # inlineCSS

#### options.decodeEntities
Decode HTML entities. Eg: `& -> &`
Type: `Boolean`
Default: `true`
#### options.inlineStyleTags
Inline content in `<style>` tags found in the HTML document
Type: `Boolean`
Default: `true`
#### options.removeClasses

@@ -54,0 +66,0 @@ Remove class attributes

@@ -7,3 +7,3 @@ var inlineCSS = require('../index'),

inlineCSS.inlineFile(inFile, outFile, function() {
inlineCSS.inlineFile(inFile, outFile, { decodeEntities: false }, function() {
console.log('Test: Inlining file');

@@ -10,0 +10,0 @@ console.log('----------------------------------');