NAME
HTML::Lint - check for HTML errors in a string or file
SYNOPSIS
my $lint = HTML::Lint->new;
$lint->parse( $data );
$lint->parse_file( $filename );
my $error_count = $lint->errors;
foreach my $error ( $lint->errors ) {
print $error->as_string, "\n";
}
VERSION
Version 0.94
$Header: /cvsroot/html-lint/html-lint/lib/HTML/Lint.pm,v 1.10 2002/05/31 20:43:25 petdance Exp $
EXPORTS
None. It's all object-based.
METHODS
HTML::Lint
is based on the HTML::Parser module. Any method call that works with HTML::Parser
will work in <HTML::Lint>. However, you'll probably only want to use the parse()
or parse_file()
methods.
- new()
-
Create an HTML::Lint object, which inherits from HTML::Parser. The
new
method takes no arguments. - errors()
-
In list context,
errors
returns all of the errors found in the parsed text. In scalar context, it returns the number of errors found. - clear_errors()
-
Clears the list of errors, in case you want to print and clear, print and clear.
newfile( $filename )
Call newfile()
whenever you switch to another file in a batch of linting. Otherwise, the object thinks everything is from the same file.
SEE ALSO
HTML::Lint::Error, HTML::Parser
TODO
Allow a "check this string" method for building into tests.
Check for attributes that require values
For instance, BGCOLOR should be BGCOLOR="something", but if it's just BGCOLOR, that's a problem. (Plus, that crashes IE OSX)
Check form validity: Are any fields duplicated on the form?
Add link checking
Handle obsolete tags
Create a .t file for each potential error message
LICENSE
This code may be distributed under the same terms as Perl itself.
Please note that these modules are not products of or supported by the employers of the various contributors to the code.
AUTHOR
Andy Lester, <andy@petdance.com>
2 POD Errors
The following errors were encountered while parsing the POD:
- Around line 121:
You forgot a '=back' before '=head2'
- Around line 299:
=back without =over