html-minifier-next 5.2.0 → 5.2.2
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/dist/htmlminifier.cjs
CHANGED
|
@@ -3998,10 +3998,14 @@ async function minifyHTML(value, options, partialMarkup) {
|
|
|
3998
3998
|
options.name = identity;
|
|
3999
3999
|
options.insideSVG = lowerTag === 'svg';
|
|
4000
4000
|
options.insideForeignContent = true;
|
|
4001
|
-
// Disable HTML-specific options that produce invalid XML
|
|
4002
|
-
|
|
4001
|
+
// Disable HTML-specific options that produce invalid XML:
|
|
4002
|
+
// SVG with `minifySVG` enabled is passed to SVGO, which requires valid XML input;
|
|
4003
|
+
// MathML is never processed by SVGO, so these restrictions never apply to it
|
|
4004
|
+
if (lowerTag === 'svg' && options.minifySVG) {
|
|
4005
|
+
options.removeAttributeQuotes = false;
|
|
4006
|
+
options.decodeEntities = false;
|
|
4007
|
+
}
|
|
4003
4008
|
options.removeTagWhitespace = false;
|
|
4004
|
-
options.decodeEntities = false;
|
|
4005
4009
|
}
|
|
4006
4010
|
// `foreignObject` in SVG and `annotation-xml` in MathML contain HTML content
|
|
4007
4011
|
// Note: The element itself is in SVG/MathML namespace, only its children are HTML
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"htmlminifier.d.ts","sourceRoot":"","sources":["../../src/htmlminifier.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"htmlminifier.d.ts","sourceRoot":"","sources":["../../src/htmlminifier.js"],"names":[],"mappings":"AAssDO,8BAJI,MAAM,YACN,eAAe,GACb,OAAO,CAAC,MAAM,CAAC,CAwB3B;;;;;;;;;;;;UAz+CS,MAAM;YACN,MAAM;YACN,MAAM;mBACN,MAAM;iBACN,MAAM;kBACN,MAAM;;;;;;;;;;;;;4BAQN,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,EAAE,qBAAqB,EAAE,CAAC,GAAG,EAAE,MAAM,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9
9
|
"entities": "^7.0.1",
|
|
10
|
-
"lightningcss": "^1.
|
|
10
|
+
"lightningcss": "^1.32.0",
|
|
11
11
|
"svgo": "^4.0.1",
|
|
12
12
|
"terser": "^5.46.0"
|
|
13
13
|
},
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@commitlint/cli": "^20.3.1",
|
|
17
17
|
"@eslint/js": "^10.0.1",
|
|
18
|
-
"@rollup/plugin-commonjs": "^29.0.
|
|
18
|
+
"@rollup/plugin-commonjs": "^29.0.2",
|
|
19
19
|
"@rollup/plugin-json": "^6.1.0",
|
|
20
20
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
21
21
|
"@swc/core": "^1.15.11",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"rollup": "^4.59.0",
|
|
24
24
|
"rollup-plugin-polyfill-node": "^0.13.0",
|
|
25
25
|
"typescript": "^5.9.3",
|
|
26
|
-
"vite": "^
|
|
26
|
+
"vite": "^8.0.1"
|
|
27
27
|
},
|
|
28
28
|
"exports": {
|
|
29
29
|
".": {
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"pack",
|
|
60
60
|
"packer",
|
|
61
61
|
"svg",
|
|
62
|
+
"svgo",
|
|
62
63
|
"swc",
|
|
63
64
|
"terser",
|
|
64
65
|
"uglifier",
|
|
@@ -95,5 +96,5 @@
|
|
|
95
96
|
},
|
|
96
97
|
"type": "module",
|
|
97
98
|
"types": "./dist/types/htmlminifier.d.ts",
|
|
98
|
-
"version": "5.2.
|
|
99
|
+
"version": "5.2.2"
|
|
99
100
|
}
|
package/src/htmlminifier.js
CHANGED
|
@@ -1101,10 +1101,14 @@ async function minifyHTML(value, options, partialMarkup) {
|
|
|
1101
1101
|
options.name = identity;
|
|
1102
1102
|
options.insideSVG = lowerTag === 'svg';
|
|
1103
1103
|
options.insideForeignContent = true;
|
|
1104
|
-
// Disable HTML-specific options that produce invalid XML
|
|
1105
|
-
|
|
1104
|
+
// Disable HTML-specific options that produce invalid XML:
|
|
1105
|
+
// SVG with `minifySVG` enabled is passed to SVGO, which requires valid XML input;
|
|
1106
|
+
// MathML is never processed by SVGO, so these restrictions never apply to it
|
|
1107
|
+
if (lowerTag === 'svg' && options.minifySVG) {
|
|
1108
|
+
options.removeAttributeQuotes = false;
|
|
1109
|
+
options.decodeEntities = false;
|
|
1110
|
+
}
|
|
1106
1111
|
options.removeTagWhitespace = false;
|
|
1107
|
-
options.decodeEntities = false;
|
|
1108
1112
|
}
|
|
1109
1113
|
// `foreignObject` in SVG and `annotation-xml` in MathML contain HTML content
|
|
1110
1114
|
// Note: The element itself is in SVG/MathML namespace, only its children are HTML
|