Tool to find malformed HTML? - html

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.

This sounds like a job for HTML Tidy.

HTMLTidy will fix your errors
xmllint will find your errors

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.

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

If you want a command line interface, you can use: https://github.com/yaniswang/HTMLHint
It has also its grunt plugin: https://github.com/yaniswang/grunt-htmlhint

Related

Find missing HTML tag

Is there a tool which I can use to see missing tag in HTML?
For e.g. if I wrote <div> but forgot to end it with </div> so is there a tool for this? I have a very large HTML file and I suspect because of missing tag I am having problems in displaying so need some tool that can identify it.
Try to validate page on W3 validator (validate via file uplod)it will show all errors.
You can use the Auto-Format feature (Ctrl+K+D) of Microsoft Visual Studio - it reformats your code so that you can easily see whether there are missing tags. I love this feature, it often comes in handy.
You can use http://validator.w3.org/ or notepad++ is the best option to check div's.
Any tool which gives you basic text editing tools can tell you this very easily.Some useful tools are:
1. Visual Studio
2. Notepad++
3. MS word(yes this also shows)
4. Front Page(very old player in this field)
Lots of many more.
Above of all, open your page in chrome or Mozilla then press F12, see the code and fix it.

quickest way to find broken DIVs

I have a site that is calling a great deal of HTML from a third party source. Trouble is, I think they are returning malformed code to me.
I need a quick way to find additional DIV closures, is this possible?
create a page calling just the provided code then validate it - W3C Validator
Just install View shource chart add on for firefox and u can find the source generated in a formatted manner which is easy to find the unwanted tags..
You can try this:
http://www.tormus.com/en/tools/div_checker
Will find non matching divs for you. Very helpful
Try w3 org validator
While an IDE is not specifically mentioned, I would highly recommend putting the code into an IDE.
In Dreamweaver CS6 you can Validate directly to WC3 from within Dreamweaver. When an error is found you can go directly to that portion of the code and leverage the tools of the IDE.

best HTML validator/parser?

I have a large HTML file, and it looks like some tags are not closed. It's hard to find it. I am using VIM as the editor.
Is there any good way to find it?
You can validate your html using http://validator.w3.org/
Just make sure you specify the DOCTYPE correctly and it'll find anything that is invalid.
I assume you are on running Linux?! If so, you could try Eclipse
It is a complete IDE, which will help you in many cases and make programming a lot more efficient
Just use Notepad++. It is free and light weight code editor, and I already found many unclosed tags in my html with it...
HTML Validator (extension for Firefox) has helped me in the past. You need to load the page in the browser to find the errors.
If you can put you code online you could try Dr. Watson.
Another validator to try is the CSE HTML Validator. The online version is here:
http://www.OnlineWebCheck.com/

how to validate html code

i want to check the mistake of our html code.
are you suggest me some method in firefox to improve mark up code and solve old code mistake.
How to edit the html. who give me error list node by node like a ul is missing etc.
I think you need to look at the Web Developer Toolkit and Firebug plugins. Between them you can do just about anything you need to do in terms of debugging html and css.
Firefox addon:
HTML Validator
W3C:
W3C Validator
HI,
You should use firebug for this will help to developer to know about error or mistake.
and
http://validator.w3.org/ is also help to know mistakes and some software as dreamweaver and notepad++ will help.
Try going to http://validator.w3.org/
You're after this: http://validator.w3.org/.
Not sure what you're referring to specifically. If you're talking about W3C validation you can access the validator tool here.
If something isn't displaying right you could install firebug (Firefox addon) to see what's happening, though this is more of a CSS issue than html.
Without knowing the specifics of your problem it is hard to give more specific advice than that.
If you're using Java on the server side, you can add the JTidy servlet to your web.xml to validate all HTML generated by your web application.

Show HTML errors in Google Chrome?

Can Google Chrome show HTML errors (e.g. unclosed <div> tags)?
If so, how does one do it?
~Use HTML Validator extension.~
https://chrome.google.com/webstore/detail/html-validator/mpbelhhnfhfjnaehkcnnaknldmnocglk.
Another options is to use the W3C validator "favelets" to open the W3C validator from a bookmark.
http://validator.w3.org/favelets.html
I'm not sure it can do exactly what you're after without an extension. You can use the developer tools to explore the HTML to see if it is what you expect/intend, but I don't think it will tell you where there are errors.
HTML browsers are designed to be able to taken invalid markup and render it as best they can. It will have a very high tolerance for errors.
You may want to try an extension like one of these.
There is a new HTML5 validator for based on libTidy (same as the firefox version)
https://chrome.google.com/webstore/detail/anjdemaoejlpgmnmkijdemoiebcddhkc
I prefer Validity as it shows errors in the devtools console. It also lets you set up a list of hostnames where it should run on each page load which has been super useful for me during development.