I need to modify a chunk of HTML code that was exported from another program. This code was never intended to be read by human eyes, so while it is technically error-free (tags properly ordered and closed, etc.), the formatting leaves much to desired. One line in particular is 16,548 characters long without a line break. You can see where this would be annoying to work with.
I’m looking for a program that will format this code to be more easily readable. It can either modify the file directly, or allow me to paste the contents into the program for formatting. Proper indenting would be wonderful, but anything that adds line breaks between tags at reasonable intervals would suit my purposes just fine. I’m hoping someone has had this same problem and has written an application specifically to solve it…this is just the sort of thing I’m usually good at googling up freeware for, but for whatever reason this one eludes me.
I presume I could do something like this with emacs, vi or the like, but I never learned either (yeah, I know, I’ll turn in my coder card later) and I don’t have time right now to learn a complex editor. That said, if there’s a built-in function that does this that’s relatively easy to apply, I’m game.
If there’s nothing out there specifically for this purpose, I can write a macro to throw in a line break after every end tag, but I’m hoping for something a little more…elegant than that. Anyone have any suggestions?