SYNOPSIS

See HTML::Lint for all the gory details.

EXPORTS

None. It's all object-based.

METHODS

Almost everything is an accessor. Each error has a type. Note that these roughly, but not exactly, go from most severe to least severe.

  • \*(C`STRUCTURE\*(C' For problems that relate to the structural validity of the code. Examples: Unclosed <\s-1TABLE\s0> tags, incorrect values for attributes, and repeated attributes.

  • \*(C`HELPER\*(C' Helpers are notes that will help you with your \s-1HTML\s0, or that will help the browser render the code better or faster. Example: Missing \s-1HEIGHT\s0 and \s-1WIDTH\s0 attributes in an \s-1IMG\s0 tag.

  • \*(C`FLUFF\*(C' Fluff is for items that don't hurt your page, but don't help it either. This is usually something like an unknown attribute on a tag.

\fInew()\fP

Create an object. It's not very exciting. Tells if any of $type1, $type2... match the error's type. Returns the type that matched.

    if ( $err->is_type( HTML::Lint::Error::STRUCTURE ) ) {....

\fIwhere()\fP

Returns a formatted string that describes where in the file the error has occurred.

For example,

(14:23)

for line 14, column 23.

The terrible thing about this function is that it's both a plain ol' formatting function as in

my $str = where( 14, 23 );

\s-1AND\s0 it's an object method, as in:

my $str = $error->where();

I don't know what I was thinking when I set it up this way, but it's bad practice.

\fIas_string()\fP

Returns a nicely-formatted string for printing out to stdout or some similar user thing.

\fIfile()\fP

Returns the filename of the error, as set by the caller.

\fIline()\fP

Returns the line number of the error.

\fIcolumn()\fP

Returns the column number, starting from 0

\fIerrcode()\fP

Returns the HTML::Lint error code. Don't rely on this, because it will probably go away.

\fIerrtext()\fP

Descriptive text of the error

\fItype()\fP

Type of the error

POSSIBLE ERRORS

Each possible error in HTML::Lint has a code. These codes are used to identify each error for when you need to turn off error checking for a specific error.

config-unknown-directive

Unknown directive \*(L"\s-1DIRECTIVE\s0\*(R"

You specified a directive in a comment for HTML::Lint that it didn't recognize.

config-unknown-value

Unknown value \*(L"\s-1VALUE\s0\*(R" for \s-1DIRECTIVE\s0 directive

Directive values can only be \*(L"on\*(R", \*(L"off\*(R", \*(L"yes\*(R", \*(L"no\*(R", \*(L"true\*(R", \*(L"false\*(R", \*(L"0\*(R" and \*(L"1\*(R".

elem-unknown

Unknown element <\s-1TAG\s0>

HTML::Lint doesn't know what a \s-1TAG\s0 tag is. These are pulled from HTML::Entities

elem-unopened

</TAG> with no opening <\s-1TAG\s0>

elem-unclosed

<\s-1TAG\s0> at \s-1WHERE\s0 is never closed

elem-empty-but-closed

<\s-1TAG\s0> is not a container \*(-- </TAG> is not allowed

elem-img-alt-missing

<img src=\*(L"\s-1FILENAME\s0.PNG\*(R"> does not have \s-1ALT\s0 text defined

elem-img-sizes-missing

<img src=\*(L"\s-1FILENAME\s0.PNG\*(R"> tag has no \s-1HEIGHT\s0 and \s-1WIDTH\s0 attributes

elem-nonrepeatable

<\s-1TAG\s0> is not repeatable, but already appeared at \s-1WHERE\s0

doc-tag-required

<\s-1TAG\s0> tag is required

attr-repeated

\s-1ATTR\s0 attribute in <\s-1TAG\s0> is repeated

attr-unknown

Unknown attribute \*(L"\s-1ATTR\s0\*(R" for tag <\s-1TAG\s0>

text-invalid-entity

Entity \s-1ENTITY\s0 is invalid

text-unclosed-entity

Entity \s-1ENTITY\s0 is missing its closing semicolon

text-unknown-entity

Entity \s-1ENTITY\s0 is unknown

text-use-entity

Character \*(L"\s-1CHAR\s0\*(R" should be written as \s-1ENTITY\s0

COPYRIGHT & LICENSE

Copyright 2005-2012 Andy Lester.

This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License v2.0.

http://www.opensource.org/licenses/Artistic-2.0

AUTHOR

Andy Lester, \*(C`andy at petdance.com\*(C'