Mike Earley
Mike Earley

Reputation: 1293

How can I reformat HTML to add line breaks after closing tags?

I've got an html file that is all lumped together...eg:

<tr><td class="stat_WS">6</td><td class="stat_BS">6</td><td class="stat_St">3/4</td><td     class="stat_To">3</td><td class="stat_Wo">2</td><td class="stat_In">6</td><td class="stat_At">3/4</td><td class="stat_Ld">9</td><td class="stat_Save">5+/2(i)</td></tr></tbody></table><div class="wargear">Wargear</div><table class="options"><tr class="opt_dePGL"><td class="name">Phantasm Grenade Launcher</td><td class="cost">0</td></tr>

I want to automatically run through it and break the line after every closing tag. Help?

Upvotes: 0

Views: 1038

Answers (1)

Darkwater
Darkwater

Reputation: 1386

If you really need to do this within Sublime, hit Ctrl+H and replace: (</[a-z]+>) with $1\n. (make sure to check "Regular Expresseion")

For a full reformatting, there are lots of formatters online, like this one: http://www.freeformatter.com/html-formatter.html

Upvotes: 3

Related Questions