HTML::...::Error(3pm)
π HTML::Lint::Error β the error object for the Lint functionality π
okay bestie, buckle up, we're in HTML::Lint::Error(3pm) territory β this is the little error object that HTML::Lint hands you when your markup is doing the most. π
β¨ NAME β¨
HTML::Lint::Error β the Error object for the Lint functionality, iykyk.
πΈ SYNOPSIS πΈ
See HTML::Lint for all the gory details. literally all of them. it's giving "go read the other page first." π¦
π EXPORTS π
None. It's all object-based. no cap, there is nothing to import here, she's fully self-contained. π
π METHODS π
Almost everything is an accessor. like, the vast majority. it's giving "getter nation."
π Error types: "STRUCTURE", "HELPER", "FLUFF" π
Every single error has a type. and listen β these roughly, but not exactly, go from most severe to least severe. so don't come for me about the ordering, it's approximate. π
"STRUCTURE"β for problems that relate to the structural validity of the code. Examples: unclosed<TABLE>tags, incorrect values for attributes, and repeated attributes. this is the "your page is structurally going through it" tier. π"HELPER"β helpers are notes that will help you with your HTML, or that will help the browser render the code better or faster. Example: missingHEIGHTandWIDTHattributes in anIMGtag. she's not mad, she's just helping. π«Ά"FLUFF"β 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. harmless. decorative. a little garnish. β¨
new()
Create an object. It's not very exciting. fr fr, that's the whole thing. π
is_type( $type1 [, $type2 ] )
Tells if any of $type1, $type2... match the error's type. Returns the type that matched. the way that it just tells you which one hit?? obsessed.
if ( $err->is_type( HTML::Lint::Error::STRUCTURE ) ) {....
where()
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 );
AND 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. not me admitting my crimes in the documentation π iconic behavior honestly, but yeah, bad practice, do not emulate.
as_string()
Returns a nicely-formatted string for printing out to stdout or some similar user thing. she's presentable. she's ready for the timeline. π
file()
Returns the filename of the error, as set by the caller. you told her, she remembers. π
line()
Returns the line number of the error.
column()
Returns the column number, starting from 0. zero-indexed, because of course. π§
errcode()
Returns the HTML::Lint error code. Don't rely on this, because it will probably go away. she's on borrowed time bestie, do not build a whole personality around her. π
errtext()
Descriptive text of the error.
type()
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. so yes, you can absolutely mute one specific hater. π
api-parse-not-called
You called the "errors()" method before calling "parse()" and "eof()". jumping the gun a little. π
api-eof-not-called
You called the "errors()" method before calling "eof()". same energy, slightly smaller gun. π
config-unknown-directive
Unknown directive "DIRECTIVE"
You specified a directive in a comment for HTML::Lint that it didn't recognize. she doesn't know her. π
config-unknown-value
Unknown value "VALUE" for DIRECTIVE directive
Directive values can only be "on", "off", "yes", "no", "true", "false", "0" and "1". that's the whole menu, bestie, no substitutions. π
elem-unknown
HTML::Lint doesn't know recognize the tag. (that's the original wording, I'm not fixing it, I'm just the messenger π«Ά)
elem-unopened
"</tag>" with no opening "<tag>". she appeared out of nowhere with no backstory. π
elem-unclosed
"<tag>" at WHERE is never closed. the tag is still talking. nobody ended the conversation. π
elem-empty-but-closed
"<tag>" is not a container -- "</tag>" is not allowed. you tried to close something that was never open like that. π«
elem-img-alt-missing
"<img src="FILENAME.PNG">" does not have ALT text defined. accessibility said hello. π
elem-img-sizes-missing
"<img src="FILENAME.PNG">" tag has no HEIGHT and WIDTH attributes. the browser is out here guessing. π
elem-nonrepeatable
"<tag>" is not repeatable, but already appeared at WHERE. ma'am, you were already here. π
doc-tag-required
"<tag>" tag is required. mandatory. non-negotiable. periodt. π
attr-repeated
ATTR attribute in "<tag>" is repeated. saying it twice doesn't make it more true. π
attr-unknown
Unknown attribute "ATTR" for tag "<tag>". who is she? where did she come from? πΈ
text-unclosed-entity
Entity ENTITY is missing its closing semicolon. the semicolon is right there. it's right there. π
text-unknown-entity
Entity ENTITY is unknown.
text-use-entity
Character "CHAR" should be written as ENTITY. please, for the love of everything, use the entity. β¨
π COPYRIGHT & LICENSE π
Copyright 2005-2018 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
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 at petdance.com"
and that's the whole page, bestie!! β¨πππ¦πΈπ π«Άπ₯ππβππππ§π
this little love letter was brought to you by perl v5.32.0, dated 2020-12-28, and filed under HTML::...::Error(3pm) β go forth and lint responsibly, mwah π
π¦ where this page comes from
- debian bookworm: libhtml-lint-perl 2.32+dfsg-1.1 Β· Artistic-2.0
- debian trixie: libhtml-lint-perl 2.32+dfsg-1.1 Β· Artistic-2.0
- ubuntu jammy: libhtml-lint-perl 2.32+dfsg-1.1 Β· Artistic-2.0
- ubuntu noble: libhtml-lint-perl 2.32+dfsg-1.1 Β· Artistic-2.0
- ubuntu resolute: libhtml-lint-perl 2.32+dfsg-1.1 Β· Artistic-2.0
- ubuntu stonking: libhtml-lint-perl 2.32+dfsg-1.1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms