|
11 | 11 | public struct HTMLMinifierOptions: Sendable { |
12 | 12 |
|
13 | 13 | /// Treat attributes in case sensitive manner (useful for custom HTML tags) |
14 | | - /// @default false |
| 14 | + /// - Default: `false` |
15 | 15 | public var caseSensitive: Bool |
16 | 16 |
|
17 | 17 | /// Omit attribute values from boolean attributes |
18 | | - /// @default false |
| 18 | + /// - Default: `false` |
19 | 19 | public var collapseBooleanAttributes: Bool |
20 | 20 |
|
21 | 21 | /// Don't leave any spaces between `display:inline;` elements when collapsing. |
22 | 22 | /// Must be used in conjunction with `collapseWhitespace=true` |
23 | | - /// @default false |
| 23 | + /// - Default: `false` |
24 | 24 | public var collapseInlineTagWhitespace: Bool |
25 | 25 |
|
26 | 26 | /// Collapse white space that contributes to text nodes in a document tree |
27 | | - /// @default false |
| 27 | + /// - Default: `false` |
28 | 28 | public var collapseWhitespace: Bool |
29 | 29 |
|
30 | 30 | /// Always collapse to 1 space (never remove it entirely). |
31 | 31 | /// Must be used in conjunction with `collapseWhitespace=true` |
32 | | - /// @default false |
| 32 | + /// - Default: `false` |
33 | 33 | public var conservativeCollapse: Bool |
34 | 34 |
|
35 | 35 | /// Handle parse errors instead of aborting |
36 | | - /// @default false |
| 36 | + /// - Default: `false` |
37 | 37 | public var continueOnParseError: Bool |
38 | 38 |
|
39 | 39 | /// Use direct Unicode characters whenever possible |
40 | | - /// @default false |
| 40 | + /// - Default: `false` |
41 | 41 | public var decodeEntities: Bool |
42 | 42 |
|
43 | 43 | /// Parse input according to HTML5 specifications |
44 | | - /// @default true |
| 44 | + /// - Default: `true` |
45 | 45 | public var html5: Bool |
46 | 46 |
|
47 | 47 | /// Insert tags generated by HTML parser |
48 | | - /// @default true |
| 48 | + /// - Default: `true` |
49 | 49 | public var includeAutoGeneratedTags: Bool |
50 | 50 |
|
51 | 51 | /// Keep the trailing slash on singleton elements |
52 | | - /// @default false |
| 52 | + /// - Default: `false` |
53 | 53 | public var keepClosingSlash: Bool |
54 | 54 |
|
55 | 55 | /// Maximum input length to prevent ReDoS attacks (disabled by default) |
56 | | - /// @default nil |
| 56 | + /// - Default: `nil` |
57 | 57 | public var maxInputLength: Int? |
58 | 58 |
|
59 | 59 | /// Specify a maximum line length. |
60 | 60 | /// Compressed output will be split by newlines at valid HTML split-points |
61 | | - /// @default nil |
| 61 | + /// - Default: `nil` |
62 | 62 | public var maxLineLength: Int? |
63 | 63 |
|
64 | 64 | /// Minify CSS in style elements and style attributes |
65 | | - /// @default false |
| 65 | + /// - Default: `false` |
66 | 66 | public var minifyCSS: Bool |
67 | 67 |
|
68 | 68 | /// Minify JavaScript in script elements and event attributes |
69 | | - /// @default false |
| 69 | + /// - Default: `false` |
70 | 70 | public var minifyJS: Bool |
71 | 71 |
|
72 | 72 | /// Minify URLs in various attributes |
73 | | - /// @default false |
| 73 | + /// - Default: `false` |
74 | 74 | public var minifyURLs: Bool |
75 | 75 |
|
76 | 76 | /// Never add a newline before a tag that closes an element |
77 | | - /// @default false |
| 77 | + /// - Default: `false` |
78 | 78 | public var noNewlinesBeforeTagClose: Bool |
79 | 79 |
|
80 | 80 | /// Always collapse to 1 line break (never remove it entirely) when whitespace between tags include a line break. |
81 | 81 | /// Must be used in conjunction with `collapseWhitespace=true` |
82 | | - /// @default false |
| 82 | + /// - Default: `false` |
83 | 83 | public var preserveLineBreaks: Bool |
84 | 84 |
|
85 | 85 | /// Prevents the escaping of the values of attributes |
86 | | - /// @default false |
| 86 | + /// - Default: `false` |
87 | 87 | public var preventAttributesEscaping: Bool |
88 | 88 |
|
89 | 89 | /// Process contents of conditional comments through minifier |
90 | | - /// @default false |
| 90 | + /// - Default: `false` |
91 | 91 | public var processConditionalComments: Bool |
92 | 92 |
|
93 | 93 | /// Type of quote to use for attribute values ("'" or """) |
94 | | - /// @default nil |
| 94 | + /// - Default: `nil` |
95 | 95 | public var quoteCharacter: String? |
96 | 96 |
|
97 | 97 | /// Remove quotes around attributes when possible |
98 | | - /// @default false |
| 98 | + /// - Default: `false` |
99 | 99 | public var removeAttributeQuotes: Bool |
100 | 100 |
|
101 | 101 | /// Strip HTML comments |
102 | | - /// @default false |
| 102 | + /// - Default: `false` |
103 | 103 | public var removeComments: Bool |
104 | 104 |
|
105 | 105 | /// Remove all attributes with whitespace-only values |
106 | | - /// @default false |
| 106 | + /// - Default: `false` |
107 | 107 | public var removeEmptyAttributes: Bool |
108 | 108 |
|
109 | 109 | /// Remove all elements with empty contents |
110 | | - /// @default false |
| 110 | + /// - Default: `false` |
111 | 111 | public var removeEmptyElements: Bool |
112 | 112 |
|
113 | 113 | /// Remove optional tags |
114 | | - /// @default false |
| 114 | + /// - Default: `false` |
115 | 115 | public var removeOptionalTags: Bool |
116 | 116 |
|
117 | 117 | /// Remove attributes when value matches default |
118 | | - /// @default false |
| 118 | + /// - Default: `false` |
119 | 119 | public var removeRedundantAttributes: Bool |
120 | 120 |
|
121 | 121 | /// Remove `type="text/javascript"` from `script` tags. |
122 | 122 | /// Other `type` attribute values are left intact |
123 | | - /// @default false |
| 123 | + /// - Default: `false` |
124 | 124 | public var removeScriptTypeAttributes: Bool |
125 | 125 |
|
126 | 126 | /// Remove `type="text/css"` from `style` and `link` tags. |
127 | 127 | /// Other `type` attribute values are left intact |
128 | | - /// @default false |
| 128 | + /// - Default: `false` |
129 | 129 | public var removeStyleLinkTypeAttributes: Bool |
130 | 130 |
|
131 | 131 | /// Remove space between attributes whenever possible. |
132 | 132 | /// **Note that this will result in invalid HTML!** |
133 | | - /// @default false |
| 133 | + /// - Default: `false` |
134 | 134 | public var removeTagWhitespace: Bool |
135 | 135 |
|
136 | 136 | /// Sort attributes by frequency |
137 | | - /// @default false |
| 137 | + /// - Default: `false` |
138 | 138 | public var sortAttributes: Bool |
139 | 139 |
|
140 | 140 | /// Sort style classes by frequency |
141 | | - /// @default false |
| 141 | + /// - Default: `false` |
142 | 142 | public var sortClassName: Bool |
143 | 143 |
|
144 | 144 | /// Trim white space around `ignoreCustomFragments` |
145 | | - /// @default false |
| 145 | + /// - Default: `false` |
146 | 146 | public var trimCustomFragments: Bool |
147 | 147 |
|
148 | 148 | /// Replaces the `doctype` with the short (HTML5) doctype |
149 | | - /// @default false |
| 149 | + /// - Default: `false` |
150 | 150 | public var useShortDoctype: Bool |
151 | 151 |
|
152 | 152 | public init( |
|
0 commit comments