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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "html-minifier",
3
3
  "description": "Highly configurable, well-tested, JavaScript-based HTML minifier.",
4
- "version": "3.5.11",
4
+ "version": "3.5.12",
5
5
  "keywords": [
6
6
  "cli",
7
7
  "compress",
@@ -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, '&amp$1').replace(/</g, '&lt;');
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;