Melros
Melros

Reputation: 1213

Auto indent code in an HTML file (generator/tool)

I was wondering if there is a tool or generator that could auto indent my code after production from:

<div>
<div>
<p>
</p>
</div>
</div>

to:

<div>
     <div>
          <p>
          </p>
     </div>
</div>

Does something like this exist?

Upvotes: 2

Views: 3438

Answers (2)

Fatih Acet
Fatih Acet

Reputation: 29569

Try js-beautify.

It's a JavaScript beautifier but works for HTML too.

Upvotes: 3

austincheney
austincheney

Reputation: 1199

You can try Pretty Diff, which can also handle JSLT type tags.

Upvotes: 3

Related Questions