html-minifier 3.5.11 → 3.5.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/htmlminifier.js +5 -5
package/package.json
CHANGED
package/src/htmlminifier.js
CHANGED
|
@@ -1153,11 +1153,6 @@ function minify(value, options, partialMarkup) {
|
|
|
1153
1153
|
trimTrailingWhitespace(buffer.length - 1, nextTag);
|
|
1154
1154
|
}
|
|
1155
1155
|
}
|
|
1156
|
-
else if (uidPattern) {
|
|
1157
|
-
text = text.replace(uidPattern, function(match, prefix, index) {
|
|
1158
|
-
return ignoredCustomMarkupChunks[+index][0];
|
|
1159
|
-
});
|
|
1160
|
-
}
|
|
1161
1156
|
if (!stackNoCollapseWhitespace.length && nextTag !== 'html' && !(prevTag && nextTag)) {
|
|
1162
1157
|
text = collapseWhitespace(text, options, false, false, true);
|
|
1163
1158
|
}
|
|
@@ -1191,6 +1186,11 @@ function minify(value, options, partialMarkup) {
|
|
|
1191
1186
|
// https://mathiasbynens.be/notes/ambiguous-ampersands
|
|
1192
1187
|
text = text.replace(/&(#?[0-9a-zA-Z]+;)/g, '&$1').replace(/</g, '<');
|
|
1193
1188
|
}
|
|
1189
|
+
if (uidPattern && options.collapseWhitespace && stackNoTrimWhitespace.length) {
|
|
1190
|
+
text = text.replace(uidPattern, function(match, prefix, index) {
|
|
1191
|
+
return ignoredCustomMarkupChunks[+index][0];
|
|
1192
|
+
});
|
|
1193
|
+
}
|
|
1194
1194
|
currentChars += text;
|
|
1195
1195
|
if (text) {
|
|
1196
1196
|
hasChars = true;
|