homepage Welcome to WebmasterWorld Guest from 54.196.62.132
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / WYSIWYG and Text Code Editors
Forum Library, Charter, Moderator: open

WYSIWYG and Text Code Editors Forum

    
HTML code "beautifier"?
Maintaining 3rd party code
pmkpmk




msg:940385
 3:00 pm on Jan 23, 2006 (gmt 0)

Hi,

I found myself in the position to maintain someone else's HTML code. His coding style can only be called "interesting".

Can anyone recommend an external HTML formatter/beautifier that at least indents and structures spagetthi-code a bit?

 

jetboy




msg:940386
 3:48 pm on Jan 23, 2006 (gmt 0)

Dreamweaver and HomeSite both have this kind of functionality. The open source HTML Tidy would probably be your best bet.

moltar




msg:940387
 4:18 pm on Jan 23, 2006 (gmt 0)

I'll second HTMLTidy - really a neat tool. I use it all the time. You can create your own config file with your preferences for markup indents/capitalization/anything you can imagine and use it for all your projects.

limbo




msg:940388
 9:53 pm on Jan 23, 2006 (gmt 0)

Another vote for html tidy. DW won't do a good job unless you reign it in a little. It's nicknamed 'the Beaver' for a reason ;)

pmkpmk




msg:940389
 9:57 pm on Jan 23, 2006 (gmt 0)

OK, got the message :-)

Actually there was an online version of it which worked quite well, though it complained about some Javascript issues. I'm going to have a look at the standalone version since I want some more formatting (like a blank line in front of <Hx> tags).

pageoneresults




msg:940390
 10:03 pm on Jan 23, 2006 (gmt 0)

Actually there was an online version of it which worked quite well, though it complained about some Javascript issues. I'm going to have a look at the standalone version since I want some more formatting (like a blank line in front of <Hx> tags).

You can do this with FrontPage too. Go into Page Options and configure the formatting for tags. Once you do that, open the page in FrontPage and switch to HTML (Code) view. Right click the page while in Code view. Select Reformat HTML from the menu and it's done. I've been using it for years and it will clean even the most difficult of pages. One thing to be careful of though are empty attributes. FrontPage does not like empty attributes when using the Reformat HTML command. It will basically take this ...alt=""> and change it to ...alt>.

P.S. FrontPage 2003 does not exhibit the above behavior so it appears to have been addressed.

[edited by: pageoneresults at 10:10 pm (utc) on Jan. 23, 2006]

limbo




msg:940391
 10:05 pm on Jan 23, 2006 (gmt 0)

Find and replace in your favourite Dev tool will do that easy enough - if HTML tidy wont, notepad ++ will. Loving Regular expression searches since I discovered them.

and what p1r said ;)

pmkpmk




msg:940392
 10:09 pm on Jan 23, 2006 (gmt 0)

@pageoneresults: Frontpage is a commercial tool. Since I own GoLive which came with the Adobe bundle, I don't want to invest in another commercial editor (especially since I barely have the need for one). Most of my pages come from a CMS (Typo3), and on those rare occasions I need to write some code myself I use Scite which does identation as I code.

Only for 3rd party code I would need some cleanup.

pageoneresults




msg:940393
 10:17 pm on Jan 23, 2006 (gmt 0)

Since I own GoLive which came with the Adobe bundle, I don't want to invest in another commercial editor (especially since I barely have the need for one).

I just opened up my copy of GoLive CS2 and it looks like you have complete control over HTML code formatting and can probably set up a similar routine. I'm not that familiar with the GoLive product, but if you have it, and can figure it out, you already have one of the best page cleaners available.

I don't want to invest in another commercial editor.

$76.00 to $200.00

Would typically pay for itself after one cleaning. ;)

[edited by: pageoneresults at 10:20 pm (utc) on Jan. 23, 2006]

pmkpmk




msg:940394
 10:20 pm on Jan 23, 2006 (gmt 0)

Mine is CS1 (or only "CS") and I looked hard to see if it can clean imported code - which does not seem to be true.

But the issue is already solved, so no need to dig deeper (though I appreciate your feedback).

pmkpmk




msg:940395
 8:42 am on Jan 24, 2006 (gmt 0)

Well the price of Frontpage seems low, but then we get into TCO discussion: I never worked with it before so I need time to learn it. As a typical MS program, it will most likely want to install gazillion new libraries and frameworks on my PC thus endangering future stability etc...

limbo




msg:940396
 9:42 am on Jan 24, 2006 (gmt 0)

Considering the pro's and cons of FP and DW I know where my choice would lie - No contest. Copies of DW4 are very cheap to buy + upgrade.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / WYSIWYG and Text Code Editors
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved