3zzy wrote:
Thanks Steve, but I'm not sure what to change in that code snippet, following is the full command source:
Don't change anything in the command. Run the Tidy command as normal, then follow it by doing a Find & Replace operation. So, say you start with the following HTML:
<h1> Hello, world! </h1><ul><li> first </li> <li>second</li><li>third </li> </ul>
Now, run the Tidy command from the HTML bundle. Your output may be slightly different, but when I run it I get:
<h1> Hello, world! </h1> <ul> <li>first </li> <li>second </li> <li>third </li> </ul>
Now, to fix up the ugly list formatting I do ⌘F to open the Find dialog.
Find: <li>[ \n]*(.*?)[ \n]*</li> Replace: <li>$1</li> Regular expression: checked
Hit "Replace All", and the list elements are lined up like they should be.
<h1> Hello, world! </h1> <ul> <li>first</li> <li>second</li> <li>third</li> </ul>
The Find expression above is a little more complex than the one I posted earlier, but it should handle some wackier formats.