Download the PHP package voku/html-min without Composer
On this page you can find all versions of the php package voku/html-min. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download voku/html-min
More information about voku/html-min
Files in voku/html-min
Package html-min
Short Description HTML Compressor and Minifier
License MIT
Homepage https://github.com/voku/HtmlMin
Informations about the package html-min
:clamp: HtmlMin: HTML Compressor and Minifier for PHP
Description
HtmlMin is a fast and very easy to use PHP library that minifies given HTML5 source by removing extra whitespaces, comments and other unneeded characters without breaking the content structure. As a result pages become smaller in size and load faster. It will also prepare the HTML for better gzip results, by re-ranging (sort alphabetical) attributes and css-class-names.
Install via "composer require"
Quick Start
Options
Current optional tag support from the WHATWG HTML syntax rules:
<html>: start tag may be omitted when the first child is not a comment; end tag may be omitted when the element is not immediately followed by a comment.<head>: start tag may be omitted when the element is empty or starts with an element; end tag may be omitted when it is not immediately followed by ASCII whitespace or a comment.<body>: start tag may be omitted when the element is empty or starts with something other than ASCII whitespace / a comment /meta/noscript/link/script/style/template; end tag may be omitted when it is not immediately followed by a comment.<p>: end tag may be omitted beforeaddress,article,aside,blockquote,details,dialog,div,dl,fieldset,figcaption,figure,footer,form,h1-h6,header,hgroup,hr,main,menu,nav,ol,p,pre,search,section,table, orul, or at the end of the parent when the parent is nota,audio,del,ins,map,noscript,video, or an autonomous custom element.<li>,<dt>,<dd>,<rt>,<rp>,<tr>,<td>, and<th>: the end tag may be omitted in the standard adjacent-sibling / end-of-parent cases from the spec.<option>: the end tag may be omitted before anotheroption,optgroup, orhr, or at the end of the parent.<optgroup>: the end tag may be omitted before anotheroptgrouporhr, or at the end of the parent.<colgroup>: the start tag may be omitted when the first child iscoland the previous omitted-tag rule does not block it; the end tag may be omitted when it is not immediately followed by ASCII whitespace or a comment.<caption>: the end tag may be omitted when it is not immediately followed by ASCII whitespace or a comment.<thead>: the end tag may be omitted beforetbodyortfoot.<tbody>: the start tag may be omitted when the first child istrand the previous omitted-tag rule does not block it; the end tag may be omitted beforetbody/tfootor at the end of the parent.<tfoot>: the end tag may be omitted at the end of the parent.
Start tags are never omitted when the element has attributes.
PS: you can use the "nocompress"-tag to keep the html e.g.: "
Unit Test
1) Composer is a prerequisite for running the tests.
2) The tests can be executed by running this command from the root directory:
Support
For support and donations please visit Github | Issues | PayPal | Patreon.
For status updates and release announcements please visit Releases | Twitter | Patreon.
For professional support please contact me.
Thanks
- Thanks to GitHub (Microsoft) for hosting the code and a good infrastructure including Issues-Managment, etc.
- Thanks to IntelliJ as they make the best IDEs for PHP and they gave me an open source license for PhpStorm!
- Thanks to Travis CI for being the most awesome, easiest continous integration tool out there!
- Thanks to StyleCI for the simple but powerful code style check.
- Thanks to PHPStan & Psalm for really great Static analysis tools and for discovering bugs in the code!
All versions of html-min with dependencies
voku/simple_html_dom Version ^5.0
ext-dom Version *
tedivm/jshrink Version ^1.8.1