5 <meta http-equiv="X-UA-Compatible" content="IE=edge">
6 <title>HTML minifier</title>
7 <link rel="stylesheet" href="assets/master.css">
10 <div id="outer-wrapper">
12 <h1>HTML Minifier <span>(v3.5.10)</span></h1>
13 <textarea rows="8" cols="40" id="input"></textarea>
14 <div class="minify-button">
15 <button type="button" id="minify-btn">Minify</button>
17 <textarea rows="8" cols="40" id="output" readonly></textarea>
24 <input type="checkbox" id="caseSensitive">
25 <label for="caseSensitive">
28 <span class="quiet short">
29 Treat attributes in case sensitive manner (useful for custom HTML tags)
33 <input type="checkbox" id="collapseBooleanAttributes" checked>
34 <label for="collapseBooleanAttributes">
35 Collapse boolean attributes
37 <span class="quiet short">
38 Omit attribute values from boolean attributes
42 <input type="checkbox" id="collapseInlineTagWhitespace">
43 <label for="collapseInlineTagWhitespace" class="unsafe">
44 Collapse inline tag whitespace
46 <span class="quiet short">
47 Don't leave any spaces between <code>display:inline;</code> elements when collapsing.
48 Must be used in conjunction with <code>collapseWhitespace=true</code>
52 <input type="checkbox" id="collapseWhitespace" checked>
53 <label for="collapseWhitespace">
56 <span class="quiet short">
57 Collapse white space that contributes to text nodes in a document tree
61 <input type="checkbox" id="conservativeCollapse">
62 <label for="conservativeCollapse">
65 <span class="quiet short">
66 Always collapse to 1 space (never remove it entirely).
67 Must be used in conjunction with <code>collapseWhitespace=true</code>
71 <input type="checkbox" id="decodeEntities" checked>
72 <label for="decodeEntities">
73 Decode Entity Characters
75 <span class="quiet short">
76 Use direct Unicode characters whenever possible
80 <input type="checkbox" id="html5" checked>
84 <span class="quiet short">
85 Parse input according to HTML5 specifications
89 <input type="checkbox" id="includeAutoGeneratedTags">
90 <label for="includeAutoGeneratedTags">
91 Include auto-generated tags
93 <span class="quiet short">
94 Insert tags generated by HTML parser
98 <input type="checkbox" id="keepClosingSlash">
99 <label for="keepClosingSlash">
102 <span class="quiet short">
103 Keep the trailing slash on singleton elements
107 <label for="maxLineLength">
110 <input type="text" id="maxLineLength">
111 <span class="quiet short">
112 Specify a maximum line length. Compressed output will be split by newlines at valid HTML split-points
116 <input type="checkbox" id="minifyCSS" checked>
117 <label for="minifyCSS">
120 <span class="quiet short">
121 Minify CSS in style elements and style attributes (uses <code>clean-css</code>)
125 <input type="checkbox" id="minifyJS" checked>
126 <label for="minifyJS">
129 <span class="quiet short">
130 Minify JavaScript in script elements and event attributes (uses <code>UglifyJS</code>)
134 <label for="minifyURLs">
137 <input type="text" id="minifyURLs">
138 <span class="quiet short">
139 Minify URLs in various attributes (uses <code>relateurl</code>)
143 <input type="checkbox" id="preserveLineBreaks">
144 <label for="preserveLineBreaks">
147 <span class="quiet short">
148 Always collapse to 1 line break (never remove it entirely) when whitespace between tags include a line break.
149 Must be used in conjunction with <code>collapseWhitespace=true</code>
153 <input type="checkbox" id="preventAttributesEscaping">
154 <label for="preventAttributesEscaping" class="unsafe">
155 Prevent attributes escaping
157 <span class="quiet short">
158 Prevents the escaping of the values of attributes
162 <input type="checkbox" id="processConditionalComments" checked>
163 <label for="processConditionalComments">
164 Process conditional comments
166 <span class="quiet short">
167 Process contents of conditional comments through minifier
171 <label for="processScripts">
174 <input type="text" id="processScripts" value="text/html">
175 <span class="quiet short">
176 Comma-delimited string corresponding to types of script elements to process through minifier (e.g. <code>text/ng-template, text/x-handlebars-template</code>)
180 <label for="quoteCharacter">
183 <input type="text" id="quoteCharacter">
184 <span class="quiet short">
185 Type of quote to use for attribute values (<code>'</code> or <code>"</code>)
189 <input type="checkbox" id="removeAttributeQuotes" checked>
190 <label for="removeAttributeQuotes">
191 Remove attribute quotes
193 <span class="quiet short">
194 Remove quotes around attributes when possible
198 <input type="checkbox" id="removeComments" checked>
199 <label for="removeComments">
202 <span class="quiet short">
207 <input type="checkbox" id="removeEmptyAttributes" checked>
208 <label for="removeEmptyAttributes">
209 Remove empty attributes
211 <span class="quiet short">
212 Remove all attributes with whitespace-only values
216 <input type="checkbox" id="removeEmptyElements">
217 <label for="removeEmptyElements" class="unsafe">
218 Remove empty elements
220 <span class="quiet short">
221 Remove all elements with empty contents
225 <input type="checkbox" id="removeOptionalTags" checked>
226 <label for="removeOptionalTags">
231 <input type="checkbox" id="removeRedundantAttributes" checked>
232 <label for="removeRedundantAttributes">
233 Remove redundant attributes
235 <span class="quiet short">
236 Remove attributes when value matches default.
240 <input type="checkbox" id="removeScriptTypeAttributes" checked>
241 <label for="removeScriptTypeAttributes">
242 Remove script type attributes
244 <span class="quiet short">
245 Remove <code>type="text/javascript"</code> from <code>script</code> tags.
246 Other <code>type</code> attribute values are left intact
250 <input type="checkbox" id="removeStyleLinkTypeAttributes" checked>
251 <label for="removeStyleLinkTypeAttributes">
252 Remove style link type attributes
254 <span class="quiet short">
255 Remove <code>type="text/css"</code> from <code>style</code> and <code>link</code> tags.
256 Other <code>type</code> attribute values are left intact
260 <input type="checkbox" id="removeTagWhitespace" checked>
261 <label for="removeTagWhitespace" class="unsafe">
262 Remove tag whitespace
264 <span class="quiet short">
265 Remove space between attributes whenever possible.
266 <i>Note that this will result in invalid HTML!</i>
270 <input type="checkbox" id="sortAttributes" checked>
271 <label for="sortAttributes" class="unsafe">
274 <span class="quiet short">
275 Sort attributes by frequency
279 <input type="checkbox" id="sortClassName" checked>
280 <label for="sortClassName" class="unsafe">
283 <span class="quiet short">
284 Sort style classes by frequency
288 <input type="checkbox" id="trimCustomFragments" checked>
289 <label for="trimCustomFragments">
290 Trim white space around custom fragments
292 <span class="quiet short">
293 Trim white space around <code>ignoreCustomFragments</code>.
297 <input type="checkbox" id="useShortDoctype" checked>
298 <label for="useShortDoctype">
299 Use short <code>doctype</code>
301 <span class="quiet short">
302 Replaces the <code>doctype</code> with the short (HTML5) <code>doctype</code>
306 <div class="controls">
308 <a href="#" id="select-all">All</a>,
309 <a href="#" id="select-none">None</a>,
310 <a href="#" id="select-defaults">Reset</a>
317 HTMLMinifier is made by <a href="http://perfectionkills.com/">kangax</a>,
318 using tweaked version of HTML parser by <a href="http://ejohn.org/">John Resig</a>
319 (which, in its turn, is based on work of <a href="http://erik.eae.net/">Erik Arvidsson</a>).
320 Source and bugtracker are <a href="https://github.com/kangax/html-minifier">hosted on GitHub</a>.
324 <script src="dist/htmlminifier.min.js"></script>
325 <script src="assets/master.js"></script>