As an example, I ran it on Randal's website:
$ weblint http://www.stonehenge.com/merlyn
http://www.stonehenge.com/merlyn (213:5) <IMG> tag has no HEIGHT and WIDTH attributes.
http://www.stonehenge.com/merlyn (290:279) <IMG> tag has no HEIGHT and WIDTH attributes.
http://www.stonehenge.com/merlyn (293:1) <td> at (292:6) is never closed
Nothing very serious, since most browsers will handle the unclosed TD tag, and the IMG HEIGHT & WIDTH are just rendering helpers. Still, they're worth fixing.
Here's another example from someone still fixing up the pages for his upcoming book:
http://site/ (5:79) <link> is not a container -- </link> is not allowed
http://site/ (208:1) <form> at (198:1) is never closed
http://site/ (210:1) </form> with no opening <form>
http://site/ (225:6) <td> at (39:1) is never closed
http://site/ (225:6) <div> at (40:1) is never closed
http://site/ (225:6) <table> at (35:1) is never closed
Here, the problems could get into rendering issues. Older Netscapes would just freak out on unclosed tables and refuse to draw. The pair of FORM tag mismatches are probably a nesting issue.
Finally, here's a
#!/usr/bin/perl -w
use strict;
use Test::More;
use Test::HTML::Lint;
use File::Spec;
use File::Find::Rule;
my $startpath = '.';
my $rule = File::Find::Rule->new;
$rule->or( $rule->new->directory->name('CVS')->prune->discard,
$rule->new->file->name('*.html') );
my @html = $rule->in( $startpath );
my $nfiles = scalar @html;
plan( tests => $nfiles );
for my $filename ( @html ) {
open( my $fh, $filename ) or fail( "Couldn't open $filename" ), next;
local $/ = undef;
my $text = <$fh>;
close $fh;
html_ok( $text, $filename );
}
Shocked, shocked (Score:3, Funny)
And even steakhouses don't always have good vegetarian food.
Reply to This
Automatic Application (Score:3, Interesting)
This has been a real boon for developing a correctly validating site. Otherwise, we'd have to wait for our web designer to run the page through the validator later on and then bitch at us to fix our code. Instant feedback rocks.
-Dom
Reply to This
Re:Automatic Application (Score:2)
-sam
Re:Automatic Application (Score:2)
--
xoa
Re:Automatic Application (Score:2)
Now, let's see if the HTML dudes even want it! Even if they don't, I might keep it around to help me find their mistakes more easily.
Thanks!
-sam
Re:Automatic Application (Score:2)
--
xoa
Re:Automatic Application (Score:2)
-sam
Re:Automatic Application (Score:2)
-Dom
Re:Automatic Application (Score:2)
Not only that, but I've realised that XML::LibXML does DTD validation now; it should be able to do the same checking in memory rather than expensively spawning a copy of nsgmls.
Hmmm... There is much work to do today!
-Dom
Very cool! (Score:1)