Home » W3C » w3c online tool HTML TIDY auto Correct to Valid HTML file

w3c online tool HTML TIDY auto Correct to Valid HTML file

  Introduction to TIDY

When editing HTML it's easy to make mistakes. Wouldn't it be nice if there was a simple way to fix these mistakes automatically and tidy up sloppy editing into nicely layed out markup? Well now there is! Dave Raggett's HTML TIDY is a free utility for doing just that. It also works great on the atrociously hard to read markup generated by specialized HTML editors and conversion tools, and can help you identify where you need to pay further attention on making your pages more accessible to people with disabilities.
Tidy is able to fix up a wide range of problems and to bring to your attention things that you need to work on yourself. Each item found is listed with the line number and column so that you can see where the problem lies in your markup. Tidy won't generate a cleaned up version when there are problems that it can't be sure of how to handle. These are logged as "errors" rather than "warnings".
Dave Raggett has now passed the baton for maintaining Tidy to a group of volunteers working together as part of the open source community at Source Forge. The source code continues to be available under an open source license, and you are encouraged to pass on bug reports and enhancement requests at http://tidy.sourceforge.net.
More recently, Tidy has been extended to support HTML5 and to clean up HTML exported from Google Docs. The source code is available on github, see tidy-html5.
If you find HTML Tidy useful and you would like to say thanks, then please send me a (paper) postcard or other souvenir from the area in which you live along with a few words on what you are using Tidy for. It will be fun to map out where Tidy users are to be found! My postal address is given at the end of this file.
The W3C public email list devoted to HTML Tidy is: <html-tidy@w3.org>. To subscribe send an email to html-tidy-request@w3.org with the word subscribe in the subject line (include the word unsubscribe if you want to unsubscribe). The archive for this list is accessible online. If you would like to contact the developers, or you just want to submit an enhancement request or a bug report, please visit http://tidy.sourceforge.net.
Tidy can now perform wonders on HTML saved from Microsoft Word 2000! Word bulks out HTML files with stuff for round-tripping presentation between HTML and Word. If you are more concerned about using HTML on the Web, check out Tidy's "Word-2000" config option! Of course Tidy does a good job on Word'97 files as well!
Tidy features in an article by Scott Nesbitt on webreview.com, and more recently on Dave Central's Best of Linux, and as tool of the month on Unix Review by Joe Brockmeier, who writes:
"One thing I love about the UNIX philosophy is the idea that each program should do one job and do it really well. There are zillions of small tools for UNIX-type OSes that make life much easier and are hugely useful, but they don't necessarily get written about. They certainly don't receive the same kind of coverage that Apache and Sendmail receive. One of my favorites, HTML Tidy, is a tool for HTML/Web development that I think will interest a lot of folks. HTML Tidy cleans up HTML produced by WYSIWYG editors and such."
Tidy is available as a downloadable binary, as source code (ANSI C), or as an online service at W3C, Info Network, HTML Help's site Valet and other sites  .

   

   Tutorials for HTML and CSS

If you are just starting off and would like to know more about how to author Web pages, you may find my guide to HTML and CSS helpful. Please send me feedback on this, and I will do my best to further improve it. cc

   HTML Slidy - a Web based alternative to PowerPoint

A new relative to Tidy, HTML Slidy is my open source presentation tool for slides written in XHTML. It provides an accessible alternative to traditional presentation tools like Microsoft PowerPoint. Best of all, there is no software to install, it just works from the Web!

  Examples of TIDY at work

Tidy corrects the markup in a way that matches where possible the observed rendering in popular browsers from Netscape and Microsoft. Here are just a few examples of how TIDY perfects your HTML for you:
  • Missing or mismatched end tags are detected and corrected
       <h1>heading
       <h2>subheading</h3>
    is mapped to
       <h1>heading</h1>
       <h2>subheading</h2>
  • End tags in the wrong order are corrected:
       <p>here is a para <b>bold <i>bold italic</b> bold?</i> normal?
    
    is mapped to
       <p>here is a para <b>bold <i>bold italic</i> bold?</b> normal?
    
  • Fixes problems with heading emphasis
       <h1><i>italic heading</h1>
       <p>new paragraph
    In Netscape and Internet Explorer this causes everything following the heading to be in the heading font size, not the desired effect at all!
    Tidy maps the example to
       <h1><i>italic heading</i></h1>
       <p>new paragraph
  • Recovers from mixed up tags
       <i><h1>heading</h1></i>
       <p>new paragraph <b>bold text
       <p>some more bold text
    Tidy maps this to
       <h1><i>heading</i></h1>
       <p>new paragraph <b>bold text</b>
       <p><b>some more bold text</b>
  • Getting the <hr> in the right place:
       <h1><hr>heading</h1>
       <h2>sub<hr>heading</h2>
    Tidy maps this to
       <hr>
       <h1>heading</h1>
    <h2>sub</h2>
    eading<
    <hr> <h2>
    h/h2>
  • Adding the missing "/" in end tags for anchors:
       <a href="#refs">References<a>
    
    Tidy maps this to
       <a href="#refs">References</a>
    
  • Perfecting lists by putting in tags missed out:
       <body>
       <li>1st list item
       <li>2nd list item
    is mapped to
       <body>
    <ul>
    st list item</li> <li>
    <li> 12nd list item</li>
    </ul>
  • Missing quotes around attribute values are added
    Tidy inserts quote marks around all attribute values for you. It can also detect when you have forgotten the closing quote mark, although this is something you will have to fix yourself.
  • Unknown/Proprietary attributes are reported
    Tidy has a comprehensive knowledge of the attributes defined in the HTML 4.0 recommendation from W3C. This often allows you to spot where you have mistyped an attribute or value.
  • Proprietary elements are recognized and reported as such.
    Tidy will even work out which version of HTML you are using and insert the appropriate DOCTYPE element, as per the W3C recommendations.
  • Tags lacking a terminating '>' are spotted
    This is something you then have to fix yourself as Tidy is unsure of where the > should be inserted.

0 comments:

Post a Comment