Socket
Socket
Sign inDemoInstall

minimize

Package Overview
Dependencies
75
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.5.13 to 0.5.14

5

lib/helpers.js

@@ -77,3 +77,4 @@ 'use strict';

return (/[\s=]+/).test(value) || this.config.quotes
// Always quote attributes having spaces or ending in a slash.
return value.slice(-1) === '/' || (/[\s=]+/).test(value) || this.config.quotes
? '"' + value + '"'

@@ -132,3 +133,3 @@ : value;

if (!self.config.empty && !retain.test(key) && !bool && !value) return result;
// Boolean attributes should be adde sparse.
// Boolean attributes should be added sparse.
if (!self.config.spare && bool) return result + ' ' + key;

@@ -135,0 +136,0 @@ // Return full attribute with value.

16

package.json
{
"name": "minimize",
"version": "0.5.13",
"version": "0.5.14",
"description": "Minimize HTML",

@@ -10,11 +10,11 @@ "main": "./lib/minimize",

"dependencies": {
"htmlparser2": "3.3.x",
"utile": "0.2.x"
"htmlparser2": "~3.4.0",
"utile": "~0.2.1"
},
"devDependencies": {
"mocha": "1.13.x",
"chai": "1.8.x",
"sinon": "1.7.x",
"sinon-chai": "2.4.x",
"pre-commit": "0.0.x"
"mocha": "~1.17.1",
"chai": "~1.8.1",
"sinon": "~1.7.3",
"sinon-chai": "~2.4.0",
"pre-commit": "0.0.4"
},

@@ -21,0 +21,0 @@ "repository": "git@github.com:Moveo/minimize.git",

@@ -183,2 +183,6 @@ /*global beforeEach, afterEach*/

it('should always quote an attribute ending with /', function () {
expect(helpers.quote('path/')).to.be.equal('"path/"');
});
it('should add quotes to attributes with spaces or =', function () {

@@ -185,0 +189,0 @@ expect(helpers.quote(html.attribs.class)).to.be.equal('"some classes with spaces"');

@@ -153,3 +153,3 @@ 'use strict';

minimize.parse(html.full, function (error, result) {
expect(result).to.equal("<!doctype html><html class=no-js><head></head><body class=container><section class=navigation id=navigation><nav class=row><h1><a href=/ class=logo title=\"Back to the homepage\">Nodejitsu</a></h1> <a href=#navigation class=\"mobile btn ss-rows\"></a> <a href=/paas>Cloud</a> <a href=/enterprise/private-cloud>Enterprise</a></nav></section><input type=text name=temp></body></html>");
expect(result).to.equal("<!doctype html><html class=no-js><head></head><body class=container><section class=navigation id=navigation><nav class=row><h1><a href=\"/\" class=logo title=\"Back to the homepage\">Nodejitsu</a></h1> <a href=#navigation class=\"mobile btn ss-rows\"></a> <a href=/paas>Cloud</a> <a href=/enterprise/private-cloud>Enterprise</a></nav></section><input type=text name=temp></body></html>");
done();

@@ -194,2 +194,10 @@ });

});
it('should always quote attributes that end with / regardless of options', function (done) {
var quote = new Minimize({ quotes: false });
quote.parse('<a href="#/">test</a>', function (error, result) {
expect(result).to.equal('<a href="#/">test</a>');
done();
});
});
});

@@ -196,0 +204,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc