Comparing version 0.5.1 to 0.5.2
@@ -0,1 +1,7 @@ | ||
## v0.5.2 | ||
- [Fix] Make sure script without type=test/javascript is not minified | ||
## v0.5.1 | ||
- [Fix] Improve tests against scripts | ||
## v0.5.0 | ||
@@ -2,0 +8,0 @@ - [Major] Upgrade to htmlparser2 module for faster parsing and more options. |
@@ -140,3 +140,3 @@ 'use strict'; | ||
Helpers.prototype.isJS = function isJS (element) { | ||
return (element.type === 'script' && !element.attribs) | ||
return (element.type === 'script' && (!element.attribs || !element.attribs.type)) | ||
|| (element.type === 'script' && element.attribs.type === 'text/javascript'); | ||
@@ -143,0 +143,0 @@ }; |
{ | ||
"name": "minimize", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"description": "Minimize HTML", | ||
@@ -5,0 +5,0 @@ "main": "./lib/minimize", |
@@ -283,6 +283,12 @@ /*global beforeEach, afterEach*/ | ||
it('returns true if type is script and attribute === null', function () { | ||
it('returns true if type is script and has no attributes', function () { | ||
html.script.attribs = {}; | ||
expect(helpers.isJS(html.script)).to.be.true; | ||
}); | ||
it('returns true if type is script and has random attributes', function () { | ||
html.script.attribs = { 'data-type': 'test' }; | ||
expect(helpers.isJS(html.script)).to.be.true; | ||
}); | ||
it('returns true if type is script and attribute === "text/javascript"', function () { | ||
@@ -289,0 +295,0 @@ expect(helpers.isJS(html.script)).to.be.true; |
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
42169
957