tags:

views:

222

answers:

4

I'm looking for a tool that could help me fix malformed HTML. For example:

<div id="foo">
  <div id="bar">
    <span>Test</span>    
</div>

The tool would detect a missing and inform me the the div with id 'bar' on line 2 is not closed. I know about the w3c validator (using it with the Web Developer Toolbar). But I find the validator tool slow to use. Additionally, once a tag is not closed, the rest of the page generates lots of errors.

This tool can either be a standalone application or a browser plugin.

I'm using Eclipse, JSP, JSTL and jQuery to generate HTML. Even if Eclipse give me some indication on malformed HTML, I have mostly generated code. Therefore, it would be best if the tool analyze the resulting page.

+4  A: 

This sounds like a job for HTML Tidy.

Andrew Hare
To the rescue!
Carson Myers
+1  A: 

HTMLTidy will fix your errors

xmllint will find your errors

Pierre
A: 

Even the W3C Validator will find your malformed/unclosed HTML.

I would, as a rule, always be sure to pass my HTML and CSS through their validators, though HTML Tidy is a nice little app to have around too.

Chris Sobolewski
+1  A: 

https://addons.mozilla.org/en-US/firefox/addon/249 This firefox extension has done me good as well...

nbv4