forked from kangax/html-minifier
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
173 lines (173 loc) · 7.31 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>HTML minifier</title>
<link rel="stylesheet" href="master.css" type="text/css">
</head>
<body>
<div>
<div id="outer-wrapper">
<div id="wrapper">
<h1>HTML Minifier <span style="font-size:0.6em">(ver. 0.43)</span></h1>
<p id="warning">
Minifier is <strong>very draft</strong> and is <strong>not yet thoroughly tested</strong>. Use at your own risk.
</p>
<textarea rows="8" cols="40" id="input"></textarea>
<p style="width:65%">
<button type="button" id="minify-btn">Minify</button>
</p>
<textarea rows="8" cols="40" id="output" readonly></textarea>
</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="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-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" class="unsafe">
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" class="unsafe">
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="use-htmllint" checked>
<label for="use-htmllint">
Validate input through HTML lint
</label>
</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>
<p id="stats"></p>
<div id="lint-report">
LINT REPORT:
<div id="report"></div>
</div>
<p class="quiet" style="font-style:italic;">
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>
<script src="src/htmlparser.js" type="text/javascript"></script>
<script src="src/htmlminifier.js" type="text/javascript"></script>
<script src="src/htmllint.js" type="text/javascript"></script>
<script src="master.js" type="text/javascript"></script>
</body>
</html>