문제

I have searched but could not find anything similar to what I need. I am looking for a tool that is capable of removing leading/trailing spaces in my HTML files which also have embedded JavaScript. Basically in the end, I plan to use this tool within my Nant scripts to perform this task on the fly with every deployment.

Is there already a tool that can do this, or maybe the best scripting language?

Basically, I will like what MS Word does for text using "justify (Ctrl+J)", to be done for my HTML files.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top