← Blog dev

There's a real GitHub issue about a minifier mangling the whitespace inside <pre> tags. We wrote a test to make sure ours never does that.

Scan to open this page

There's a real GitHub issue about a minifier mangling the whitespace inside <pre> tags. We wrote a test to make sure ours never does that.

Before building our HTML minifier/formatter, we checked two tools directly and looked into a specific, documented bug class in this category.

A known bug: minifiers that shouldn't touch <pre>, but do

There's a real GitHub issue (minify-html #21) about exactly this: a minifier not respecting whitespace inside <pre> tags, which matters because that whitespace is meant to render exactly as written. The same risk applies to <textarea>, <script>, and <style> content. We built this tool to protect those four tags specifically, then tested it directly: we fed in a <pre> block with irregular internal spacing and a <script> block with deliberately loose formatting, and confirmed both came out of minify — and separately, format — completely unchanged, byte for byte.

Live, with the number that actually matters

We checked minifier.org and cssportal.com directly: both require clicking a button (Minify, Beautify, etc.) rather than updating as you type. Ours updates live, and in Minify mode shows the concrete result — original bytes, minified bytes, and the percentage saved — not just a transformed textarea with no measurement.

Try the HTML minifier/formatter →

#HtmlMinifier#HtmlMinifierPreservesPreTextareaWhitespace#HtmlMinifierLiveNoButton#HtmlMinifierSizeReductionPercentage