tags:

views:

297

answers:

6

I've inherited some rather large static HTML files that need to be fixed up to work in webkit-based browsers, Safari in particular. One of the common bugs I've found that cause rendering differences is missing </div> tags. (Both IE7+ and FF3+ seem to ignore these, or make good guesses as to where to close the DIVs, and render as expected.) I'm used to using vim with HTML syntax highlighting for editing, but end up writing awk scripts to match starting and ending tags.

What is your favorite tool or technique for matching start and end tags in a large HTML file?

UPDATE: I'm currently in a shop that targets HTML 4.01 Strict, not XHTML.

+2  A: 

The w3c Validator can be (extremely) verbose, but it does check for missing closing tags.

Triptych
+5  A: 

The W3C HTML Validator works fairly well, or if you want something a little simpler then the Tidy FireFox plugin also works.

Brandon
THANKS, I just tried out FireFox "HTML Validator" and it is great. My cravings for simplicity and effectiveness are satisfied.
Smandoli
No problem, but if you're satisified your question has been resolved, please remember to mark the question as answered.
Brandon
@Brandon: I was just waiting a bit to see what other answers came in.
system PAUSE
@system PAUSE, actually I confused you with Smandoli. I thought this was his question, my mistake :P
Brandon
+2  A: 

Most IDE's usually let you know via highlighting, fuzzy-underline or a warning.

Dominic Bou-Samra
+1  A: 

HTML Tidy is a great command line tool. I often use it with WGet

bryanbcook
A: 

What is your favorite tool or technique for matching start and end tags in a large HTML file?

A text editor with a built-in XML well-formedness checker, combined with using XHTML for everything.

bobince
Would like to know which ones you favor.
Smandoli
I used to use one of the plugins for EmEditor on Windows.
bobince
+1  A: 

vim/gvim & NetBeans both do a great job of tag matching

Mike
I've followed the exact instructions in ":help matchit", but % still doesn't work for me in vim (Cygwin).
system PAUSE
It's hard to say what's wrong, you might try this http://www.catonmat.net/blog/vim-plugins-matchit-vim/ or download gvim for Windoze and not go through cygwin.
Mike
@Mike, I've rephrased my complaint as a question at http://stackoverflow.com/questions/1440292. Feel free to answer there.
system PAUSE