- Why whitespace between inline elements is kept
- The markup <b>a</b> <i>b</i> renders as "a b". Remove that space and it becomes "ab", the words run together. Aggressive minifiers that strip it produce exactly this bug. Space between block-level elements has no rendered effect and is removed.
- Protected regions
- Content inside <pre>, <textarea>, <script> and <style> is left untouched. Collapsing whitespace in a <pre> would alter the display, and altering script or style content risks breaking it.
- Conditional comments survive
- Ordinary comments are removed, but conditional comments beginning <!--[if are preserved, because they carry instructions for legacy Internet Explorer rather than being documentation.
- Minification versus compression
- Gzip and Brotli already compress repeated whitespace efficiently, so minifying a compressed response yields a much smaller saving than the raw character count suggests. The benefit is clearest for HTML inlined into another document, stored uncompressed, or served without compression.