}
})(typeof exports === 'undefined' ? this : exports);
/*!
- * HTMLMinifier v0.5.2
+ * HTMLMinifier v0.5.3
* http://kangax.github.com/html-minifier/
*
* Copyright (c) 2010-2013 Juriy "kangax" Zaytsev
}
function isBooleanAttribute(attrName) {
- return (/^(?:checked|disabled|selected|readonly)$/).test(attrName);
+ return (/^(?:allowfullscreen|async|autofocus|checked|compact|declare|default|defer|disabled|formnovalidate|hidden|inert|ismap|itemscope|multiple|muted|nohref|noresize|noshade|novalidate|nowrap|open|readonly|required|reversed|seamless|selected|sortable|truespeed|typemustmatch)$/).test(attrName);
}
function isUriTypeAttribute(attrName, tag) {
{
"name": "html-minifier",
"description": "HTML minifier with lint-like capabilities.",
- "version": "0.5.2",
+ "version": "0.5.3",
"keywords": ["html", "minifier", "lint"],
"url" : "http://github.com/kangax/html-minifier",
"maintainers": [{
/*!
- * HTMLMinifier v0.5.2
+ * HTMLMinifier v0.5.3
* http://kangax.github.com/html-minifier/
*
* Copyright (c) 2010-2013 Juriy "kangax" Zaytsev
}
function isBooleanAttribute(attrName) {
- return (/^(?:checked|disabled|selected|readonly)$/).test(attrName);
+ return (/^(?:allowfullscreen|async|autofocus|checked|compact|declare|default|defer|disabled|formnovalidate|hidden|inert|ismap|itemscope|multiple|muted|nohref|noresize|noshade|novalidate|nowrap|open|readonly|required|reversed|seamless|selected|sortable|truespeed|typemustmatch)$/).test(attrName);
}
function isUriTypeAttribute(attrName, tag) {
equal(minify('<p>foo<'+el+'> baz </'+el+'>bar</p>', {collapseWhitespace: true}), '<p>foo<'+el+'>baz</'+el+'>bar</p>');
equal(minify('<p>foo <'+el+'> baz </'+el+'>bar</p>', {collapseWhitespace: true}), '<p>foo <'+el+'>baz</'+el+'>bar</p>');
equal(minify('<p>foo<'+el+'> baz </'+el+'> bar</p>', {collapseWhitespace: true}), '<p>foo<'+el+'>baz</'+el+'> bar</p>');
- })
+ })
equal(minify('<p>foo <img> bar</p>', {collapseWhitespace: true}), '<p>foo <img> bar</p>');
equal(minify('<p>foo<img>bar</p>', {collapseWhitespace: true}), '<p>foo<img>bar</p>');
equal(minify('<p>foo <img>bar</p>', {collapseWhitespace: true}), '<p>foo <img>bar</p>');
input = '<option name="blah" selected="selected">moo</option>';
equal(minify(input, { collapseBooleanAttributes: true }), '<option name="blah" selected>moo</option>');
+
+ input = '<input autofocus="autofocus">';
+ equal(minify(input, { collapseBooleanAttributes: true }), '<input autofocus>');
+
+ input = '<input required="required">';
+ equal(minify(input, { collapseBooleanAttributes: true }), '<input required>');
+
+ input = '<input multiple="multiple">';
+ equal(minify(input, { collapseBooleanAttributes: true }), '<input multiple>');
});
test('removing optional tags', function(){