aboutsummaryrefslogtreecommitdiff
path: root/node_modules/html-minifier/src/htmlminifier.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/html-minifier/src/htmlminifier.js')
-rw-r--r--node_modules/html-minifier/src/htmlminifier.js40
1 files changed, 20 insertions, 20 deletions
diff --git a/node_modules/html-minifier/src/htmlminifier.js b/node_modules/html-minifier/src/htmlminifier.js
index 5b9c9cf32..6910e15dd 100644
--- a/node_modules/html-minifier/src/htmlminifier.js
+++ b/node_modules/html-minifier/src/htmlminifier.js
@@ -131,29 +131,29 @@ function isAttributeRedundant(tag, attrName, attrValue, attrs) {
attrValue = attrValue ? trimWhitespace(attrValue.toLowerCase()) : '';
return (
- tag === 'script' &&
- attrName === 'language' &&
- attrValue === 'javascript' ||
+ tag === 'script' &&
+ attrName === 'language' &&
+ attrValue === 'javascript' ||
- tag === 'form' &&
- attrName === 'method' &&
- attrValue === 'get' ||
+ tag === 'form' &&
+ attrName === 'method' &&
+ attrValue === 'get' ||
- tag === 'input' &&
- attrName === 'type' &&
- attrValue === 'text' ||
+ tag === 'input' &&
+ attrName === 'type' &&
+ attrValue === 'text' ||
- tag === 'script' &&
- attrName === 'charset' &&
- !attributesInclude(attrs, 'src') ||
+ tag === 'script' &&
+ attrName === 'charset' &&
+ !attributesInclude(attrs, 'src') ||
- tag === 'a' &&
- attrName === 'name' &&
- attributesInclude(attrs, 'id') ||
+ tag === 'a' &&
+ attrName === 'name' &&
+ attributesInclude(attrs, 'id') ||
- tag === 'area' &&
- attrName === 'shape' &&
- attrValue === 'rect'
+ tag === 'area' &&
+ attrName === 'shape' &&
+ attrValue === 'rect'
);
}
@@ -998,10 +998,10 @@ function minify(value, options, partialMarkup) {
if (!stackNoTrimWhitespace.length) {
squashTrailingWhitespace(tag);
}
- if (!_canTrimWhitespace(tag, attrs)) {
+ if (!_canTrimWhitespace(tag, attrs) || stackNoTrimWhitespace.length) {
stackNoTrimWhitespace.push(tag);
}
- if (!_canCollapseWhitespace(tag, attrs)) {
+ if (!_canCollapseWhitespace(tag, attrs) || stackNoCollapseWhitespace.length) {
stackNoCollapseWhitespace.push(tag);
}
}