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 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 ./filethen pressggVG=, then:wq. Make sure you have a backup.Or you might try with Eclipse. Open the file and go to Source > Format.