Here is the solution I found for this.
Using the html compressor command line tool, I was able to only remove the leading spaces of the html file where as fully minifying them didnt work.
Soultion:
java -jar htmlcompressor.jar --preserve-comments --preserve-multi-spaces --preserve-line-breaks --output D:\html\foo-leading_spaces.htm D:\html\foo.htm
Using this tool to generate my desired results, I am able to apply this to my build scripts to perform this process on the fly.
Thanks everyone for their input and hope this helps others in the similar situation.