forked from kangax/html-minifier
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
267 lines (264 loc) · 10.6 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>HTML minifier</title>
<link rel="stylesheet" href="assets/master.css">
</head>
<body>
<div>
<div id="outer-wrapper">
<script id='fbyg2uy'>(function(i){var f,s=document.getElementById(i);f=document.createElement('iframe');f.src='//api.flattr.com/button/view/?uid=kangax&button=compact&url='+encodeURIComponent(document.URL);f.title='Flattr';f.height=20;f.width=110;f.style.borderWidth=0;s.parentNode.insertBefore(f,s);})('fbyg2uy');</script>
<div id="wrapper">
<h1>HTML Minifier <span>(v0.6.8)</span></h1>
<p id="warning">
Minifier is <strong>in beta</strong> and could be rough around the edges.
However, there's <a href="tests">an extensive test suite</a>.
</p>
<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 id="lint-report">
LINT REPORT:
<div id="report"></div>
</div>
</div>
<div id="options">
<ul>
<li>
<input type="checkbox" id="remove-comments" checked>
<label for="remove-comments">Remove comments</label>
<span class="quiet short" style="margin-left:1.5em;float:left;clear:both;">
Conditional comments are left intact, but their inner (insignificant) whitespace is removed.
</span>
</li>
<li>
<input type="checkbox" id="remove-comments-from-cdata" checked>
<label for="remove-comments-from-cdata">Also remove comments from scripts and styles</label>
</li>
<li>
<input type="checkbox" id="remove-cdata-sections-from-cdata" checked>
<label for="remove-cdata-sections-from-cdata">Remove CDATA sections from scripts and styles</label>
</li>
<li>
<input type="checkbox" id="collapse-whitespace" checked>
<label for="collapse-whitespace">Collapse whitespace</label>
</li>
<li>
<input type="checkbox" id="conservative-collapse">
<label for="conservative-collapse">Conservative whitespace collapse</label>
</li>
<li>
<input type="checkbox" id="collapse-boolean-attributes" checked>
<label for="collapse-boolean-attributes">
Collapse boolean attributes
<br>
<span class="quiet short">
(e.g. <code><... disabled="disabled"> → <... disabled></code>)
</span>
</label>
</li>
<li>
<input type="checkbox" id="remove-attribute-quotes" checked>
<label for="remove-attribute-quotes">
Remove attribute quotes
<br>
<span class="quiet">
(e.g. <code><p class="foo"> → <p class=foo></code>)
</span>
</label>
</li>
<li>
<input type="checkbox" id="remove-redundant-attributes" checked>
<label for="remove-redundant-attributes">Remove redundant attributes/values</label>
<div class="quiet">
<code><script language="Javascript" ...></code><br>
<code><form method="get" ...></code><br>
<code><input type="text" ...></code><br>
<code><script src="..." charset="..."></code><br>
<code><a id="..." name="..."></code><br>
<code><... onclick="javascript:..." ...></code>
</div>
</li>
<li>
<input type="checkbox" id="use-short-doctype" checked>
<label for="use-short-doctype" title="i.e. <!DOCTYPE html>">
Use short doctype
</label>
</li>
<li>
<input type="checkbox" id="remove-empty-attributes" checked>
<label for="remove-empty-attributes">
Remove empty (or blank) attributes
<br>
<span class="quiet short">
Valid attributes are: class, id, style, title, lang, dir, event attributes
</span>
</label>
</li>
<li>
<input type="checkbox" id="remove-optional-tags" checked>
<label for="remove-optional-tags">
Remove optional tags
<br>
<span class="quiet short">
Currently, only:
<code></html></code>,
<code></head></code>,
<code></body></code>,
<code></option></code>
<code></thead></code>,
<code></tbody></code>,
<code></tfoot></code>,
and
<code></tr></code>
</span>
</label>
</li>
<li>
<input type="checkbox" id="remove-ignored">
<label for="remove-ignored">
Remove ignored tags
<br>
<span class="quiet short">
Currently, only tags starting and ending with:
<code><% ... %></code>
and
<code><? ... ?></code>
</span>
</label>
</li>
<li>
<input type="checkbox" id="remove-empty-elements">
<label for="remove-empty-elements" class="unsafe">
Remove empty elements
<br>
<span class="quiet short">
All except <code>textarea</code>
</span>
</label>
</li>
<li>
<input type="checkbox" id="remove-script-type-attributes">
<label for="remove-script-type-attributes">
Remove <code>type="text/javascript"</code> from <code>script</code>'s
<br>
<span class="quiet short">
Values other than "text/javascript" (e.g. "text/vbscript") are left intact.
</span>
</label>
</li>
<li>
<input type="checkbox" id="remove-style-link-type-attributes">
<label for="remove-style-link-type-attributes">
Remove <code>type="text/css"</code> from <code>style</code>'s and <code>link</code>'s
<br>
<span class="quiet short">
Values other than "text/css" (e.g. "text/plain" or "application/atom+xml") are left intact.
</span>
</label>
</li>
<li>
<input type="checkbox" id="case-sensitive">
<label for="case-sensitive">
Case-sensitive attributes
<br>
<span class="quiet short">
Useful when minifying SVG
</span>
</label>
</li>
<li>
<input type="checkbox" id="keep-closing-slash">
<label for="keep-closing-slash">
Keep closing slash
<br>
<span class="quiet short">
Useful when minifying SVG
</span>
</label>
</li>
<li>
<input type="checkbox" id="minify-js" checked>
<label for="minify-js">
Minify JS
</label>
</li>
<li>
<input type="checkbox" id="minify-js-templates">
<label for="minify-js-templates">
Minify JS Templates
<br>
<span class="quiet short">
Minify HTML served inside script tag with a custom type attribute like "text/x-handlebars-template"
</span>
</label>
</li>
<li>
<label for="minify-js-templates-type" class="sub-option">
Template type
</label>
<input type="input" id="minify-js-templates-type">
</li>
<li>
<input type="checkbox" id="minify-css" checked>
<label for="minify-css">
Minify CSS
</label>
</li>
<li>
<input type="checkbox" id="minify-urls">
<label for="minify-urls">
Minify URLs
<br>
<span class="quiet short">
Convert absolute URLs to relative
</span>
</label>
</li>
<li>
<label for="minify-urls-siteurl" class="sub-option">
Site URL
</label>
<input type="input" id="minify-urls-siteurl">
</li>
<li>
<input type="checkbox" id="use-htmllint" checked>
<label for="use-htmllint">
Validate input through HTML lint
</label>
</li>
<li>
<label for="max-line-length" class="sub-option">
Max line length
</label>
<input type="number" id="max-line-length" value="0" min="0" max="10000">
</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-safe">Safe</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="http://github.com/kangax/html-minifier">hosted on Github</a>.
</p>
</div>
</div>
<script src="dist/htmlminifier.min.js"></script>
<script src="assets/uglify.js"></script>
<script src="assets/cleancss-browser.js"></script>
<script src="assets/relateurl-browser.js"></script>
<script src="assets/master.js"></script>
</body>
</html>