forked from kangax/html-minifier
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
328 lines (325 loc) · 12.1 KB
/
index.html
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="google-site-verification" content="3tgjKRYCVRWTziuUgYny5vY4eU7Vddvat0pLnoCuPBs">
<title>HTML minifier</title>
<link rel="stylesheet" href="assets/master.css">
</head>
<body>
<div id="outer-wrapper">
<div id="wrapper">
<h1>HTML Minifier <span>(v4.0.0)</span></h1>
<textarea rows="8" cols="40" id="input"></textarea>
<div class="minify-button">
<button type="button" id="minify-btn">Minify</button>
</div>
<textarea rows="8" cols="40" id="output" readonly></textarea>
<p id="stats"></p>
</div>
<div id="options">
<ul>
<li>
<input type="checkbox" id="caseSensitive">
<label for="caseSensitive">
Case-sensitive
</label>
<span class="quiet short">
Treat attributes in case sensitive manner (useful for custom HTML tags)
</span>
</li>
<li>
<input type="checkbox" id="collapseBooleanAttributes" checked>
<label for="collapseBooleanAttributes">
Collapse boolean attributes
</label>
<span class="quiet short">
Omit attribute values from boolean attributes
</span>
</li>
<li>
<input type="checkbox" id="collapseInlineTagWhitespace">
<label for="collapseInlineTagWhitespace" class="unsafe">
Collapse inline tag whitespace
</label>
<span class="quiet short">
Don't leave any spaces between <code>display:inline;</code> elements when collapsing.
Must be used in conjunction with <code>collapseWhitespace=true</code>
</span>
</li>
<li>
<input type="checkbox" id="collapseWhitespace" checked>
<label for="collapseWhitespace">
Collapse whitespace
</label>
<span class="quiet short">
Collapse white space that contributes to text nodes in a document tree
</span>
</li>
<li>
<input type="checkbox" id="conservativeCollapse">
<label for="conservativeCollapse">
Conservative collapse
</label>
<span class="quiet short">
Always collapse to 1 space (never remove it entirely).
Must be used in conjunction with <code>collapseWhitespace=true</code>
</span>
</li>
<li>
<input type="checkbox" id="decodeEntities" checked>
<label for="decodeEntities">
Decode Entity Characters
</label>
<span class="quiet short">
Use direct Unicode characters whenever possible
</span>
</li>
<li>
<input type="checkbox" id="html5" checked>
<label for="html5">
HTML5
</label>
<span class="quiet short">
Parse input according to HTML5 specifications
</span>
</li>
<li>
<input type="checkbox" id="includeAutoGeneratedTags">
<label for="includeAutoGeneratedTags">
Include auto-generated tags
</label>
<span class="quiet short">
Insert tags generated by HTML parser
</span>
</li>
<li>
<input type="checkbox" id="keepClosingSlash">
<label for="keepClosingSlash">
Keep closing slash
</label>
<span class="quiet short">
Keep the trailing slash on singleton elements
</span>
</li>
<li>
<label for="maxLineLength">
Max. line length
</label>
<input type="text" id="maxLineLength">
<span class="quiet short">
Specify a maximum line length. Compressed output will be split by newlines at valid HTML split-points
</span>
</li>
<li>
<input type="checkbox" id="minifyCSS" checked>
<label for="minifyCSS">
Minify CSS
</label>
<span class="quiet short">
Minify CSS in style elements and style attributes (uses <code>clean-css</code>)
</span>
</li>
<li>
<input type="checkbox" id="minifyJS" checked>
<label for="minifyJS">
Minify JavaScript
</label>
<span class="quiet short">
Minify JavaScript in script elements and event attributes (uses <code>UglifyJS</code>)
</span>
</li>
<li>
<label for="minifyURLs">
Minify URLs
</label>
<input type="text" id="minifyURLs">
<span class="quiet short">
Minify URLs in various attributes (uses <code>relateurl</code>)
</span>
</li>
<li>
<input type="checkbox" id="preserveLineBreaks">
<label for="preserveLineBreaks">
Preserve line-breaks
</label>
<span class="quiet short">
Always collapse to 1 line break (never remove it entirely) when whitespace between tags include a line break.
Must be used in conjunction with <code>collapseWhitespace=true</code>
</span>
</li>
<li>
<input type="checkbox" id="preventAttributesEscaping">
<label for="preventAttributesEscaping" class="unsafe">
Prevent attributes escaping
</label>
<span class="quiet short">
Prevents the escaping of the values of attributes
</span>
</li>
<li>
<input type="checkbox" id="processConditionalComments" checked>
<label for="processConditionalComments">
Process conditional comments
</label>
<span class="quiet short">
Process contents of conditional comments through minifier
</span>
</li>
<li>
<label for="processScripts">
Process scripts
</label>
<input type="text" id="processScripts" value="text/html">
<span class="quiet short">
Comma-delimited string corresponding to types of script elements to process through minifier (e.g. <code>text/ng-template, text/x-handlebars-template</code>)
</span>
</li>
<li>
<label for="quoteCharacter">
Quote character
</label>
<input type="text" id="quoteCharacter">
<span class="quiet short">
Type of quote to use for attribute values (<code>'</code> or <code>"</code>)
</span>
</li>
<li>
<input type="checkbox" id="removeAttributeQuotes" checked>
<label for="removeAttributeQuotes">
Remove attribute quotes
</label>
<span class="quiet short">
Remove quotes around attributes when possible
</span>
</li>
<li>
<input type="checkbox" id="removeComments" checked>
<label for="removeComments">
Remove comments
</label>
<span class="quiet short">
Strip HTML comments
</span>
</li>
<li>
<input type="checkbox" id="removeEmptyAttributes" checked>
<label for="removeEmptyAttributes">
Remove empty attributes
</label>
<span class="quiet short">
Remove all attributes with whitespace-only values
</span>
</li>
<li>
<input type="checkbox" id="removeEmptyElements">
<label for="removeEmptyElements" class="unsafe">
Remove empty elements
</label>
<span class="quiet short">
Remove all elements with empty contents
</span>
</li>
<li>
<input type="checkbox" id="removeOptionalTags" checked>
<label for="removeOptionalTags">
Remove optional tags
</label>
</li>
<li>
<input type="checkbox" id="removeRedundantAttributes" checked>
<label for="removeRedundantAttributes">
Remove redundant attributes
</label>
<span class="quiet short">
Remove attributes when value matches default.
</span>
</li>
<li>
<input type="checkbox" id="removeScriptTypeAttributes" checked>
<label for="removeScriptTypeAttributes">
Remove script type attributes
</label>
<span class="quiet short">
Remove <code>type="text/javascript"</code> from <code>script</code> tags.
Other <code>type</code> attribute values are left intact
</span>
</li>
<li>
<input type="checkbox" id="removeStyleLinkTypeAttributes" checked>
<label for="removeStyleLinkTypeAttributes">
Remove style link type attributes
</label>
<span class="quiet short">
Remove <code>type="text/css"</code> from <code>style</code> and <code>link</code> tags.
Other <code>type</code> attribute values are left intact
</span>
</li>
<li>
<input type="checkbox" id="removeTagWhitespace" checked>
<label for="removeTagWhitespace" class="unsafe">
Remove tag whitespace
</label>
<span class="quiet short">
Remove space between attributes whenever possible.
<i>Note that this will result in invalid HTML!</i>
</span>
</li>
<li>
<input type="checkbox" id="sortAttributes" checked>
<label for="sortAttributes" class="unsafe">
Sort attributes
</label>
<span class="quiet short">
Sort attributes by frequency
</span>
</li>
<li>
<input type="checkbox" id="sortClassName" checked>
<label for="sortClassName" class="unsafe">
Sort class name
</label>
<span class="quiet short">
Sort style classes by frequency
</span>
</li>
<li>
<input type="checkbox" id="trimCustomFragments" checked>
<label for="trimCustomFragments">
Trim white space around custom fragments
</label>
<span class="quiet short">
Trim white space around <code>ignoreCustomFragments</code>.
</span>
</li>
<li>
<input type="checkbox" id="useShortDoctype" checked>
<label for="useShortDoctype">
Use short <code>doctype</code>
</label>
<span class="quiet short">
Replaces the <code>doctype</code> with the short (HTML5) <code>doctype</code>
</span>
</li>
</ul>
<div class="controls">
<span>Select:</span>
<a href="#" id="select-all">All</a>,
<a href="#" id="select-none">None</a>,
<a href="#" id="select-defaults">Reset</a>
</div>
</div>
</div>
<div class="footer">
<p class="quiet">
HTMLMinifier is made by <a href="http://perfectionkills.com/">kangax</a>,
using tweaked version of HTML parser by <a href="http://ejohn.org/">John Resig</a>
(which, in its turn, is based on work of <a href="http://erik.eae.net/">Erik Arvidsson</a>).
Source and bugtracker are <a href="https://github.com/kangax/html-minifier">hosted on GitHub</a>.
</p>
</div>
<script src="dist/htmlminifier.min.js"></script>
<script src="assets/master.js"></script>
</body>
</html>