HTMLMinifier is a highly configurable, well-tested, JavaScript-based HTML minifier. Minifier options like sortAttributes and sortClassName won't impact the plain-text size of the output. However, they form long repetitive chains of characters that should improve compression ratio of gzip used in HTTP compression. SVG tags are automatically recognized, and when they are minified, both case-sensitivity and closing slashes are preserved, regardless of the minification settings used for the rest of the file. HTMLMinifier can't work with invalid or partial chunks of markup. This is because it parses markup into a tree structure, then modifies it (removing anything that was specified for removal, ignoring anything that was specified to be ignored, etc.), then it creates a markup out of that tree and returns it.

Features

  • Case-sensitive
  • Attribute values from boolean attributes
  • Collapse inline tag whitespace
  • Decode entity characters
  • Insert tags generated by HTML parser
  • Keep the trailing slash on singleton elements

Project Samples

Project Activity

See All Activity >

Categories

HTML/XHTML

License

MIT License

Follow HTMLMinifier

HTMLMinifier Web Site

Other Useful Business Software
Papirfly: Best user-friendly DAM and Content Creation Software Icon
Papirfly: Best user-friendly DAM and Content Creation Software

The #1 solution to create and manage content. On‑brand. At scale.

Papirfly provides a single online destination for all your employees and other stakeholders who are engaging with your brand, ensuring consistency in all aspects of their communications. Teams can produce infinite studio-standard marketing materials from bespoke templates, store, share and adapt them for their own markets and stay firmly educated on the brand’s purpose, guidelines and evolution – with no specialist skills or agency help necessary.
Learn More
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of HTMLMinifier!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript HTML XHTML

Registered

2021-12-10