I want to just reindent a html + php + javascript spaghetti document. The document may have broken HTML but I don't want it to fix it or remove the broken tags. I just want to reindent it correctly so its readable.
The reason is that I a 2k html document with php and javascript spaghetti code all over the place; and it just "works". The thing is, it's un-indented the spacing is a mess and it's just unreadable. So for me to be able to "fix" this mess I need to understand how it 开发者_JAVA百科works...
Tidy
seems to be breaking the document; no idea why. So I'm looking for an alternative here. Any help is appreciated.
You could try doing this in vim. Open the document with vim ./file
then press ggVG=
, then :wq
. Make sure you have a backup.
Or you might try with Eclipse. Open the file and go to Source > Format.
Not sure if it is what you need, but Dreamweaver has a nice command called "Apply source formatting" under the "comments" tab..
精彩评论