I use this: Absolute HTML Compressor
This is great and , it does NOT modify / optimize the source code , it only does what you ask for it. I personally ask only to remove comments and spaces at the beginning of each line . From the command line or in a batch file:
ahc "path/file.html" -y- -l- -q- -w+ -t- -c+ -d- -m- -b-
WARNING: the -b- option (I used above) disables the backup, so the file will be overwritten.
By the way: it also has a very nice GUI to use without a command line if you want.
source share