html-minifier-next 7.2.0 → 7.3.0
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/README.md +40 -15
- package/cli.js +28 -0
- package/dist/types/htmlminifier.d.ts +77 -20
- package/dist/types/htmlminifier.d.ts.map +1 -1
- package/dist/types/htmlparser.d.ts +11 -11
- package/dist/types/htmlparser.d.ts.map +1 -1
- package/dist/types/lib/attributes.d.ts +36 -38
- package/dist/types/lib/attributes.d.ts.map +1 -1
- package/dist/types/lib/constants.d.ts +97 -100
- package/dist/types/lib/constants.d.ts.map +1 -1
- package/dist/types/lib/content.d.ts +7 -6
- package/dist/types/lib/content.d.ts.map +1 -1
- package/dist/types/lib/elements.d.ts +13 -18
- package/dist/types/lib/elements.d.ts.map +1 -1
- package/dist/types/lib/option-definitions.d.ts +202 -299
- package/dist/types/lib/option-definitions.d.ts.map +1 -1
- package/dist/types/lib/options.d.ts +7 -14
- package/dist/types/lib/options.d.ts.map +1 -1
- package/dist/types/lib/urls.d.ts +10 -2
- package/dist/types/lib/urls.d.ts.map +1 -1
- package/dist/types/lib/utils.d.ts +30 -10
- package/dist/types/lib/utils.d.ts.map +1 -1
- package/dist/types/lib/whitespace.d.ts +7 -6
- package/dist/types/lib/whitespace.d.ts.map +1 -1
- package/dist/types/presets.d.ts +39 -37
- package/dist/types/presets.d.ts.map +1 -1
- package/dist/types/tokenchain.d.ts +13 -11
- package/dist/types/tokenchain.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/htmlminifier.js +34 -1
- package/src/lib/options.js +43 -31
- package/src/lib/urls.js +1 -1
- package/src/lib/utils.js +14 -0
|
@@ -1,101 +1,98 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
export
|
|
98
|
-
export const htmlElements: Set<string>;
|
|
99
|
-
export const reEmptyAttribute: RegExp;
|
|
100
|
-
export const specialContentElements: Set<string>;
|
|
1
|
+
declare const RE_WS_START: RegExp;
|
|
2
|
+
declare const RE_WS_END: RegExp;
|
|
3
|
+
declare const RE_ALL_WS_NBSP: RegExp;
|
|
4
|
+
declare const RE_NBSP_LEADING_GROUP: RegExp;
|
|
5
|
+
declare const RE_NBSP_LEAD_GROUP: RegExp;
|
|
6
|
+
declare const RE_NBSP_TRAILING_GROUP: RegExp;
|
|
7
|
+
declare const RE_NBSP_TRAILING_STRIP: RegExp;
|
|
8
|
+
declare const RE_EVENT_ATTR_DEFAULT: RegExp;
|
|
9
|
+
declare const RE_CAN_REMOVE_ATTR_QUOTES: RegExp;
|
|
10
|
+
declare const RE_TRAILING_SEMICOLON: RegExp;
|
|
11
|
+
declare const RE_AMP_ENTITY: RegExp;
|
|
12
|
+
declare const RE_LEGACY_ENTITIES: RegExp;
|
|
13
|
+
declare const RE_ESCAPE_LT: RegExp;
|
|
14
|
+
declare const RE_ATTR_WS_CHECK: RegExp;
|
|
15
|
+
declare const RE_ATTR_WS_COLLAPSE: RegExp;
|
|
16
|
+
declare const RE_ATTR_WS_TRIM: RegExp;
|
|
17
|
+
declare const inlineElementsToKeepWhitespaceAround: Set<string>;
|
|
18
|
+
declare const inlineElementsToKeepWhitespaceWithin: Set<string>;
|
|
19
|
+
declare const inlineElementsToKeepWhitespace: Set<string>;
|
|
20
|
+
declare const formControlElements: Set<string>;
|
|
21
|
+
declare const generalDefaults: {
|
|
22
|
+
autocorrect: string;
|
|
23
|
+
fetchpriority: string;
|
|
24
|
+
loading: string;
|
|
25
|
+
popovertargetaction: string;
|
|
26
|
+
};
|
|
27
|
+
declare const tagDefaults: {
|
|
28
|
+
area: {
|
|
29
|
+
shape: string;
|
|
30
|
+
};
|
|
31
|
+
button: {
|
|
32
|
+
type: string;
|
|
33
|
+
};
|
|
34
|
+
form: {
|
|
35
|
+
enctype: string;
|
|
36
|
+
method: string;
|
|
37
|
+
};
|
|
38
|
+
html: {
|
|
39
|
+
dir: string;
|
|
40
|
+
};
|
|
41
|
+
img: {
|
|
42
|
+
decoding: string;
|
|
43
|
+
};
|
|
44
|
+
input: {
|
|
45
|
+
colorspace: string;
|
|
46
|
+
type: string;
|
|
47
|
+
};
|
|
48
|
+
link: {
|
|
49
|
+
media: string;
|
|
50
|
+
};
|
|
51
|
+
marquee: {
|
|
52
|
+
behavior: string;
|
|
53
|
+
direction: string;
|
|
54
|
+
};
|
|
55
|
+
meta: {
|
|
56
|
+
media: string;
|
|
57
|
+
};
|
|
58
|
+
source: {
|
|
59
|
+
media: string;
|
|
60
|
+
};
|
|
61
|
+
style: {
|
|
62
|
+
media: string;
|
|
63
|
+
};
|
|
64
|
+
textarea: {
|
|
65
|
+
wrap: string;
|
|
66
|
+
};
|
|
67
|
+
track: {
|
|
68
|
+
kind: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
declare const executableScriptsMimetypes: Set<string>;
|
|
72
|
+
declare const keepScriptsMimetypes: Set<string>;
|
|
73
|
+
declare const isSimpleBoolean: Set<string>;
|
|
74
|
+
declare const isBooleanValue: Set<string>;
|
|
75
|
+
declare const collapsibleValues: Map<string, Set<string>>;
|
|
76
|
+
declare const srcsetElements: Set<string>;
|
|
77
|
+
declare const jsonScriptTypes: Set<string>;
|
|
78
|
+
declare const optionalStartTags: Set<string>;
|
|
79
|
+
declare const optionalEndTags: Set<string>;
|
|
80
|
+
declare const headerElements: Set<string>;
|
|
81
|
+
declare const descriptionElements: Set<string>;
|
|
82
|
+
declare const pBlockElements: Set<string>;
|
|
83
|
+
declare const pInlineElements: Set<string>;
|
|
84
|
+
declare const rubyEndTagOmission: Set<string>;
|
|
85
|
+
declare const rubyRtcEndTagOmission: Set<string>;
|
|
86
|
+
declare const optionElements: Set<string>;
|
|
87
|
+
declare const tableContentElements: Set<string>;
|
|
88
|
+
declare const tableSectionElements: Set<string>;
|
|
89
|
+
declare const cellElements: Set<string>;
|
|
90
|
+
declare const topLevelElements: Set<string>;
|
|
91
|
+
declare const compactElements: Set<string>;
|
|
92
|
+
declare const looseElements: Set<string>;
|
|
93
|
+
declare const trailingElements: Set<string>;
|
|
94
|
+
declare const htmlElements: Set<string>;
|
|
95
|
+
declare const reEmptyAttribute: RegExp;
|
|
96
|
+
declare const specialContentElements: Set<string>;
|
|
97
|
+
export { RE_WS_START, RE_WS_END, RE_ALL_WS_NBSP, RE_NBSP_LEADING_GROUP, RE_NBSP_LEAD_GROUP, RE_NBSP_TRAILING_GROUP, RE_NBSP_TRAILING_STRIP, RE_EVENT_ATTR_DEFAULT, RE_CAN_REMOVE_ATTR_QUOTES, RE_TRAILING_SEMICOLON, RE_AMP_ENTITY, RE_LEGACY_ENTITIES, RE_ESCAPE_LT, RE_ATTR_WS_CHECK, RE_ATTR_WS_COLLAPSE, RE_ATTR_WS_TRIM, inlineElementsToKeepWhitespaceAround, inlineElementsToKeepWhitespaceWithin, inlineElementsToKeepWhitespace, formControlElements, generalDefaults, tagDefaults, executableScriptsMimetypes, keepScriptsMimetypes, jsonScriptTypes, isSimpleBoolean, isBooleanValue, collapsibleValues, srcsetElements, optionalStartTags, optionalEndTags, headerElements, descriptionElements, pBlockElements, pInlineElements, rubyEndTagOmission, rubyRtcEndTagOmission, optionElements, tableContentElements, tableSectionElements, cellElements, topLevelElements, compactElements, looseElements, trailingElements, htmlElements, reEmptyAttribute, specialContentElements };
|
|
101
98
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/lib/constants.js"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/lib/constants.js"],"names":[],"mappings":"AAEA,QAAA,MAAM,WAAW,QAAkB,CAAC;AACpC,QAAA,MAAM,SAAS,QAAkB,CAAC;AAClC,QAAA,MAAM,cAAc,QAAsB,CAAC;AAC3C,QAAA,MAAM,qBAAqB,QAAuB,CAAC;AACnD,QAAA,MAAM,kBAAkB,QAAqB,CAAC;AAC9C,QAAA,MAAM,sBAAsB,QAAqB,CAAC;AAClD,QAAA,MAAM,sBAAsB,QAAc,CAAC;AAC3C,QAAA,MAAM,qBAAqB,QAAkB,CAAC;AAC9C,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rB,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,YAAY,EAGZ,gBAAgB,EAChB,sBAAsB,EACvB,CAAC"}
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
+
import type { ProcessedOptions } from './options.js';
|
|
1
2
|
/** @import { ProcessedOptions } from './options.js' */
|
|
2
3
|
/**
|
|
3
4
|
* @param {string} text
|
|
4
5
|
* @param {string} [type]
|
|
5
6
|
*/
|
|
6
|
-
|
|
7
|
+
declare function wrapCSS(text: string, type?: string): string;
|
|
7
8
|
/**
|
|
8
9
|
* @param {string} text
|
|
9
10
|
* @param {string} [type]
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
+
declare function unwrapCSS(text: string, type?: string): string;
|
|
12
13
|
/**
|
|
13
14
|
* @param {string} text
|
|
14
15
|
* @param {{continueOnMinifyError?: boolean, log?: Function}} options
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
|
+
declare function minifyJson(text: string, options: {
|
|
17
18
|
continueOnMinifyError?: boolean;
|
|
18
19
|
log?: Function;
|
|
19
20
|
}): string;
|
|
20
21
|
/** @param {Array<{name: string, value?: string}>} attrs */
|
|
21
|
-
|
|
22
|
+
declare function hasJsonScriptType(attrs: Array<{
|
|
22
23
|
name: string;
|
|
23
24
|
value?: string;
|
|
24
25
|
}>): boolean;
|
|
@@ -28,9 +29,9 @@ export function hasJsonScriptType(attrs: Array<{
|
|
|
28
29
|
* @param {Array<{name: string, value?: string | undefined}>} currentAttrs
|
|
29
30
|
* @param {Function} minifyHTML
|
|
30
31
|
*/
|
|
31
|
-
|
|
32
|
+
declare function processScript(text: string, options: ProcessedOptions, currentAttrs: Array<{
|
|
32
33
|
name: string;
|
|
33
34
|
value?: string | undefined;
|
|
34
35
|
}>, minifyHTML: Function): Promise<any>;
|
|
35
|
-
|
|
36
|
+
export { wrapCSS, unwrapCSS, minifyJson, hasJsonScriptType, processScript };
|
|
36
37
|
//# sourceMappingURL=content.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/lib/content.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/lib/content.js"],"names":[],"mappings":"AAKI,OAAQ,KAAA,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAApD,uDAAuD;AAMvD;;;GAGG;AACH,iBAAS,OAAO,CAAC,IAAI,EAHV,MAGU,EAAE,IAAI,AAFxB,CAAsB,EAAd,MAEgB,UAS1B;AAED;;;GAGG;AACH,iBAAS,SAAS,CAAC,IAAI,EAHZ,MAGY,EAAE,IAAI,AAF1B,CAAsB,EAAd,MAEkB,UAW5B;AAID;;;GAGG;AACH,iBAAS,UAAU,CAAC,IAAI,EAHb,MAGa,EAAE,OAAO,EAFtB;IAAC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,WAAU;CAE1B,UAWhC;AAED,2DAA2D;AAC3D,iBAAS,iBAAiB,CAAC,KAAK,EADpB,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAC,CAChB,WAU/B;AAED;;;;;GAKG;AACH,iBAAe,aAAa,CAAC,IAAI,EALtB,MAKsB,EAAE,OAAO,EAJ/B,gBAI+B,EAAE,YAAY,EAH7C,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAC,CAGH,EAAE,UAAU,UAAA,gBAiBnE;AAID,OAAO,EAEL,OAAO,EACP,SAAS,EAGT,UAAU,EACV,iBAAiB,EACjB,aAAa,EACd,CAAC"}
|
|
@@ -1,46 +1,44 @@
|
|
|
1
|
+
import type { HTMLAttribute } from './attributes.js';
|
|
2
|
+
import type { ProcessedOptions } from './options.js';
|
|
1
3
|
/** @import { HTMLAttribute } from './attributes.js' */
|
|
2
4
|
/** @import { ProcessedOptions } from './options.js' */
|
|
3
5
|
/**
|
|
4
6
|
* @param {string} optionalStartTag
|
|
5
7
|
* @param {string} tag
|
|
6
8
|
*/
|
|
7
|
-
|
|
9
|
+
declare function canRemoveParentTag(optionalStartTag: string, tag: string): boolean;
|
|
8
10
|
/**
|
|
9
11
|
* @param {string} optionalEndTag
|
|
10
12
|
* @param {string} tag
|
|
11
13
|
*/
|
|
12
|
-
|
|
14
|
+
declare function isStartTagMandatory(optionalEndTag: string, tag: string): boolean;
|
|
13
15
|
/**
|
|
14
16
|
* @param {string} optionalEndTag
|
|
15
17
|
* @param {string} tag
|
|
16
18
|
*/
|
|
17
|
-
|
|
19
|
+
declare function canRemovePrecedingTag(optionalEndTag: string, tag: string): boolean;
|
|
18
20
|
/**
|
|
19
21
|
* @param {string} tag
|
|
20
22
|
* @param {HTMLAttribute[]} attrs
|
|
21
23
|
*/
|
|
22
|
-
|
|
24
|
+
declare function canRemoveElement(tag: string, attrs: HTMLAttribute[]): boolean;
|
|
23
25
|
/**
|
|
24
26
|
* @param {string} str - Tag name or HTML-like element spec (e.g., “td” or “<span aria-hidden='true'>”)
|
|
25
27
|
* @param {ProcessedOptions} options - Options object for name normalization
|
|
26
28
|
* @returns {{tag: string, attrs: Object.<string, string|undefined>|null}|null} Parsed spec or null if invalid
|
|
27
29
|
*/
|
|
28
|
-
|
|
30
|
+
declare function parseElementSpec(str: string, options: ProcessedOptions): {
|
|
29
31
|
tag: string;
|
|
30
|
-
attrs:
|
|
31
|
-
[x: string]: string | undefined;
|
|
32
|
-
} | null;
|
|
32
|
+
attrs: Record<string, string | undefined> | null;
|
|
33
33
|
} | null;
|
|
34
34
|
/**
|
|
35
35
|
* @param {string[]} input - Array of element specifications from `removeEmptyElementsExcept` option
|
|
36
36
|
* @param {ProcessedOptions} options - Options object for parsing
|
|
37
37
|
* @returns {Array<{tag: string, attrs: Object.<string, string|undefined>|null}>} Array of parsed element specs
|
|
38
38
|
*/
|
|
39
|
-
|
|
39
|
+
declare function parseRemoveEmptyElementsExcept(input: string[], options: ProcessedOptions): Array<{
|
|
40
40
|
tag: string;
|
|
41
|
-
attrs:
|
|
42
|
-
[x: string]: string | undefined;
|
|
43
|
-
} | null;
|
|
41
|
+
attrs: Record<string, string | undefined> | null;
|
|
44
42
|
}>;
|
|
45
43
|
/**
|
|
46
44
|
* @param {string} tag - Element tag name
|
|
@@ -48,12 +46,9 @@ export function parseRemoveEmptyElementsExcept(input: string[], options: Process
|
|
|
48
46
|
* @param {Array<{tag: string, attrs: Object.<string, string|undefined>|null}>} preserveList - Parsed preserve specs
|
|
49
47
|
* @returns {boolean} True if the empty element should be preserved
|
|
50
48
|
*/
|
|
51
|
-
|
|
49
|
+
declare function shouldPreserveEmptyElement(tag: string, attrs: HTMLAttribute[], preserveList: Array<{
|
|
52
50
|
tag: string;
|
|
53
|
-
attrs:
|
|
54
|
-
[x: string]: string | undefined;
|
|
55
|
-
} | null;
|
|
51
|
+
attrs: Record<string, string | undefined> | null;
|
|
56
52
|
}>): boolean;
|
|
57
|
-
|
|
58
|
-
import type { ProcessedOptions } from './options.js';
|
|
53
|
+
export { canRemoveParentTag, isStartTagMandatory, canRemovePrecedingTag, canRemoveElement, parseElementSpec, parseRemoveEmptyElementsExcept, shouldPreserveEmptyElement };
|
|
59
54
|
//# sourceMappingURL=elements.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../../src/lib/elements.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../../src/lib/elements.js"],"names":[],"mappings":"AAaI,OAAQ,KAAA,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAQ,KAAA,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AADpD,uDAAuD;AACvD,uDAAuD;AAIvD;;;GAGG;AACH,iBAAS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