Forum Moderators: open

Message Too Old, No Replies

Code formatter?

         

pmkpmk

2:22 pm on Jan 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am looking for a tool to "beautify" or format HTML code.

So instead of:


<html><head>
<title>foo</title></head>
<body>
<h1>bar
</h1>
</body></html>

it should reformat it like this:


<html>
_<head>
__<title>foo</title>
_</head>
_<body>
__<h1>bar</h1>
_</body>
</html>

(Underlines are blanks).

Any recommendations?

cmarshall

2:32 pm on Jan 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I use BBEdit, for the Mac. I suspect that many text editors will give you this.

alfaguru

2:41 pm on Jan 4, 2007 (gmt 0)

10+ Year Member



HTML Tidy for the PC. Google for it.

pmkpmk

3:20 pm on Jan 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Tidy looks good, but it has problems with JavaScript code. Nevertheless it mostly does what I need.

Anybody can recommend something which takes care of JS as well?