+16
-18
@@ -22,4 +22,3 @@ var fs = require('fs'), | ||
| } else { | ||
| console.log('Error: Invalid param'); | ||
| return; | ||
| throw 'Error: Invalid param'; | ||
| } | ||
@@ -29,4 +28,3 @@ } | ||
| if(callback === null) { | ||
| console.log('Error: No callback function specified'); | ||
| return; | ||
| throw 'Error: No callback function specified'; | ||
| } | ||
@@ -41,3 +39,3 @@ | ||
| fs.writeFile(outFile, inlineHtml, 'utf8', function() { | ||
| callback(); | ||
| return callback(); | ||
| }); | ||
@@ -65,4 +63,3 @@ }); | ||
| } else { | ||
| console.log('Error: Invalid param'); | ||
| return; | ||
| throw 'Error: Invalid param'; | ||
| } | ||
@@ -72,8 +69,7 @@ } | ||
| if(callback === null) { | ||
| console.log('Error: No callback function specified'); | ||
| return; | ||
| throw 'Error: No callback function specified'; | ||
| } | ||
| inline(html, options, function(html) { | ||
| callback(html); | ||
| return callback(html); | ||
| }); | ||
@@ -92,6 +88,6 @@ | ||
| $ = cheerio.load(html); | ||
| $ = cheerio.load(html, { decodeEntities: false }); | ||
| var stylesheets = []; | ||
| $('link').each(function(i, elem) { | ||
@@ -116,3 +112,3 @@ // Ignore remote files | ||
| callback($.html()); | ||
| return callback($.html()); | ||
| }); | ||
@@ -133,8 +129,8 @@ } | ||
| } else { | ||
| console.log('Error: Could not locate stylesheet %s', stylesheets[0]); | ||
| return; | ||
| console.log('Error: ENOENT, could not access stylesheet %s', err.path); | ||
| return callback(false); | ||
| } | ||
| }); | ||
| } else { | ||
| callback(); | ||
| return callback(); | ||
| } | ||
@@ -152,7 +148,9 @@ } | ||
| } else { | ||
| if(callback) callback(); | ||
| if(callback) | ||
| return callback(); | ||
| } | ||
| }); | ||
| } else { | ||
| if(callback) callback(); | ||
| if(callback) | ||
| return callback(); | ||
| } | ||
@@ -159,0 +157,0 @@ }); |
+1
-1
| { | ||
| "name": "inlinecss", | ||
| "version": "1.1.1", | ||
| "version": "1.1.2", | ||
| "description": "Inlines stylesheets and style tags into html content", | ||
@@ -5,0 +5,0 @@ "author": "Ripel Labs", |
@@ -12,2 +12,3 @@ <!DOCTYPE html> | ||
| <link rel="stylesheet" href="css/overwrite.css" /> | ||
| <link rel="stylesheet" href="css/doesnotexist.css" /> | ||
| <link rel="stylesheet" href="http://remotedomain.com/stylesheet.css" /> | ||
@@ -41,2 +42,4 @@ <style> | ||
| <br/> | ||
| <a href="http://test.link?querystring=true¶meter=value">Link with query string</a> | ||
| <br/> | ||
@@ -43,0 +46,0 @@ <div id="empty" style="">Inlining on an empty style tag</div> |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
15564
1%368
-0.54%