C# port of Google’s htmlcompressor library

Since I was in the need of a stand-alone HTML compression library (also called „minify“/“minification“), I quickly ported Googles htmlcompressor library from Java to .NET (C#).

Download the sources

Please note that I only ported the core functionality (i.e. not the command line stuff) and omitted the YUI compressor calls (JavaScript and CSS) since I do not need it right now.

All HTML unit tests ran successfully, I also did about an additional 50+ tests of uncompressed, real-world comples HTML pages both with my implementation and Google’s just to see that both versions produce 100% exact results.

Thanks to this Stack Overflow posting for helping on migrating.

Update 2015-10-19

There is now a NuGet package and a GitHub project for this library.