kangax / html-minifier

Javascript-based HTML compressor/minifier (with Node.js support)
http://kangax.github.io/html-minifier/
MIT License
4.94k stars 571 forks source link

Remove empty lines from --remove-comments option #1032

Open wini3d opened 5 years ago

wini3d commented 5 years ago

How do I remove the empty lines left by the --remove-comments option?

ryo-hisano commented 5 years ago

@wini3d , What about --remove-comments --collapse-whitespace --preserve-line-breaks options?

wini3d commented 5 years ago

Thanks @ryo-hisano It's close and it works, but I also need to preserve the html indentation.

Is it currently possible?

ryo-hisano commented 5 years ago

@wini3d Certainly the indent is lost. I don't understand, I'm sorry...

wini3d commented 5 years ago

@ryo-hisano hey, no worries! your solution will do for now, thanks anyways. :)

ChauncyWu commented 5 years ago

@ryo-hisano hey, no worries! your solution will do for now, thanks anyways. :)

How to preserve the html indentation? Have you solved it?