libhtml-lint-perl-2.22+dfsg.orig/0000755000175000017500000000000012545512032014455 5ustar fsfslibhtml-lint-perl-2.22+dfsg.orig/META.yml0000644000175000017500000000153112510570712015727 0ustar fsfs--- abstract: 'check for HTML errors in a string or file' author: - 'Andy Lester ' build_requires: ExtUtils::MakeMaker: 0 configure_requires: ExtUtils::MakeMaker: 0 dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.132830' license: artistic_2 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: HTML-Lint no_index: directory: - t - inc requires: Exporter: 0 File::Find: 0 HTML::Entities: 0 HTML::Parser: 3.47 HTML::Tagset: 3.03 Test::Builder: 0 Test::More: 0 resources: bugtracker: https://github.com/petdance/html-lint/issues homepage: http://search.cpan.org/dist/html-lint license: http://www.opensource.org/licenses/artistic-license-2.0.php repository: https://github.com/petdance/html-lint version: 2.22 libhtml-lint-perl-2.22+dfsg.orig/META.json0000644000175000017500000000267112510570712016105 0ustar fsfs{ "abstract" : "check for HTML errors in a string or file", "author" : [ "Andy Lester " ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.132830", "license" : [ "artistic_2" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "HTML-Lint", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "Exporter" : "0", "File::Find" : "0", "HTML::Entities" : "0", "HTML::Parser" : "3.47", "HTML::Tagset" : "3.03", "Test::Builder" : "0", "Test::More" : "0" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/petdance/html-lint/issues" }, "homepage" : "http://search.cpan.org/dist/html-lint", "license" : [ "http://www.opensource.org/licenses/artistic-license-2.0.php" ], "repository" : { "url" : "https://github.com/petdance/html-lint" } }, "version" : "2.22" } libhtml-lint-perl-2.22+dfsg.orig/t/0000755000175000017500000000000012545512032014720 5ustar fsfslibhtml-lint-perl-2.22+dfsg.orig/t/text-invalid-entity.t0000644000175000017500000000306512506561573021046 0ustar fsfs#!perl use warnings; use strict; require 't/LintTest.pl'; checkit( [ [ 'text-unknown-entity' => qr/Entity &metalhorns; is unknown/ ], [ 'text-invalid-entity' => qr/Entity � is invalid/ ], [ 'text-invalid-entity' => qr/Entity � is invalid/ ], [ 'text-unknown-entity' => qr/Entity &xdeadbeef; is unknown/ ], ], [] ); __DATA__ Ace of ♠: A tribute to Motörhead. ® &metalhorns;

Thanks for visiting Ace of ♠

Ace of ♠ is your single source for everything related to Motörhead.

Here's an icon of my girlfriend Jenny: �

And here's an icon of a deceased cow: �

Another deceased cow: &xdeadbeef;

Here's an awesome link to "You Better Swim" from the SpongeBob movie. libhtml-lint-perl-2.22+dfsg.orig/t/elem-img-alt-missing.t0000644000175000017500000000060612506561573021043 0ustar fsfsuse warnings; use strict; require 't/LintTest.pl'; checkit( [ [ 'elem-img-alt-missing' => qr/ does not have ALT text defined/i ], ], [] ); __DATA__ Test stuff

This is my paragraph

libhtml-lint-perl-2.22+dfsg.orig/t/config-unknown-directive.t0000644000175000017500000000074012506561573022037 0ustar fsfsuse warnings; use strict; require 't/LintTest.pl'; checkit( [ # [ 'config-unknown-directive' => q{Set #1 (6:5) Unknown directive "bongo"} ], [ 'config-unknown-directive' => qr/Unknown directive "bongo"$/ ], ], [] ); __DATA__ Test stuff libhtml-lint-perl-2.22+dfsg.orig/t/text-unclosed-entity.t0000644000175000017500000000155412506561573021235 0ustar fsfs#!perl use warnings; use strict; require 't/LintTest.pl'; checkit( [ [ 'text-unclosed-entity' => qr/Entity ö is missing its closing semicolon/ ], ], [] ); __DATA__ Ace of ♠: A tribute to Motörhead. Motörhead rulez!

Here's an awesome link to "You Better Swim" from the SpongeBob movie. libhtml-lint-perl-2.22+dfsg.orig/t/50-multiple-files.t0000644000175000017500000000175212506561573020302 0ustar fsfsuse warnings; use strict; require 't/LintTest.pl'; my @files = get_paragraphed_files(); checkit( [ [ 'elem-unopened' => qr/<\/p> with no opening

/i ], [ 'elem-unclosed' => qr/ at \(6:5\) is never closed/i ], [ 'elem-unclosed' => qr/ at \(7:5\) is never closed/i ], [ 'elem-unopened' => qr/<\/b> with no opening /i ], ], @files ); __DATA__ Test stuff This is my paragraph

Test stuff

This is my paragraph

This is another paragraph

Test stuff
Gratuitous unnecessary closing tag that does NOT match to the opening [B] above.

This is my paragraph

libhtml-lint-perl-2.22+dfsg.orig/t/elem-unopened.t0000644000175000017500000000046012506561573017655 0ustar fsfsuse warnings; use strict; require 't/LintTest.pl'; checkit( [ [ 'elem-unopened' => qr/<\/p> with no opening

/i ], ], [] ); __DATA__ Test stuff This is my paragraph

libhtml-lint-perl-2.22+dfsg.orig/t/config-unknown-value.t0000644000175000017500000000124512506561573021176 0ustar fsfsuse warnings; use strict; require 't/LintTest.pl'; checkit( [ [ 'config-unknown-value' => qr/Unknown value "14" for elem-img-sizes-missing directive$/ ], ], [] ); __DATA__ Test stuff libhtml-lint-perl-2.22+dfsg.orig/t/60-add-tags.t0000644000175000017500000000143612510570631017021 0ustar fsfs#!perl use warnings; use strict; require 't/LintTest.pl'; use HTML::Lint::HTML4; # This test is the same as t/attr-unknown.t, but with tag table modification. HTML::Lint::HTML4::add_attribute( 'p', 'food' ); HTML::Lint::HTML4::add_attribute( 'body', 'cuisine' ); HTML::Lint::HTML4::add_tag( 'meal' ); HTML::Lint::HTML4::add_attribute( 'meal', 'type' ); checkit( [ [ 'attr-unknown' => qr/Unknown attribute "Yummy" for tag /i ], ], [] ); __DATA__ Test stuff

This is my paragraph about burritos

This is my paragraph about refried beans Steak burrito libhtml-lint-perl-2.22+dfsg.orig/t/elem-unknown.t0000644000175000017500000000073312506561573017542 0ustar fsfsuse warnings; use strict; require 't/LintTest.pl'; checkit( [ [ 'elem-unknown' => qr/unknown element /i ], [ 'elem-unclosed' => qr/ at \(\d+:\d+\) is never closed/i ], ], [] ); __DATA__ Test stuff

This is my paragraph

whizbang! libhtml-lint-perl-2.22+dfsg.orig/t/LintTest.pl0000644000175000017500000000312212507334676017037 0ustar fsfsuse Test::More; use HTML::Lint; sub checkit { my @expected = @{+shift}; my @linesets = @_; plan( tests => 3*(scalar @expected) + 4 ); my $lint = new HTML::Lint; isa_ok( $lint, 'HTML::Lint', 'Created lint object' ); my $n; for my $set ( @linesets ) { ++$n; $lint->newfile( "Set #$n" ); $lint->parse( $_ ) for @$set; $lint->eof; } my @errors = $lint->errors(); is( scalar @errors, scalar @expected, 'Right # of errors' ); while ( @errors && @expected ) { my $error = shift @errors; isa_ok( $error, 'HTML::Lint::Error' ); my $expected = shift @expected; is( $error->errcode, $expected->[0], 'Error codes match' ); my $match = $expected->[1]; if ( ref $match eq "Regexp" ) { like( $error->as_string, $match, 'Error matches regex' ); } else { is( $error->as_string, $match, 'Error matches string' ); } } my $dump; is( scalar @errors, 0, 'No unexpected errors found' ) or $dump = 1; is( scalar @expected, 0, 'No expected errors missing' ) or $dump = 1; if ( $dump && @errors ) { diag( "Leftover errors..." ); diag( $_->as_string ) for @errors; } } # Read in a set of sets of lines, where each "file" is separated by a # blank line in sub get_paragraphed_files { local $/ = ""; my @sets; while ( my $paragraph = ) { my @lines = split /\n/, $paragraph; @lines = map { "$_\n" } @lines; push( @sets, [@lines] ); } return @sets; } 1; # happy libhtml-lint-perl-2.22+dfsg.orig/t/strong-id.t0000644000175000017500000000164312506561573017032 0ustar fsfsuse warnings; use strict; require 't/LintTest.pl'; checkit( [ [ 'attr-unknown' => qr/Unknown attribute "bongo" for tag / ], ], [] ); =pod HTML::Lint 2.02 and weblint, Red Hat EL 3 This should result in no warnings: echo 'qwerasdf' | weblint - - (1:45) Unknown attribute "id" for tag but it gives: - (1:45) Unknown attribute "id" for tag id is a core attribute in HTML4/XHTML1: http://www.w3.org/TR/html4/html40.txt =cut __DATA__ Test stuff

A test for this bug.

Bad Bad

libhtml-lint-perl-2.22+dfsg.orig/t/attr-repeated.t0000644000175000017500000000047412506561573017666 0ustar fsfsuse strict; use warnings; require 't/LintTest.pl'; checkit( [ [ 'attr-repeated' => qr/ALIGN attribute in

is repeated/i ], ], [] ); __DATA__ Test stuff

This is my paragraph

libhtml-lint-perl-2.22+dfsg.orig/t/doc-tag-required.t0000644000175000017500000000044212506561573020254 0ustar fsfsuse warnings; use strict; require 't/LintTest.pl'; checkit( [ [ 'doc-tag-required' => qr/ tag is required/ ], ], [] ); __DATA__ Test stuff

This is my paragraph

libhtml-lint-perl-2.22+dfsg.orig/t/12-html_fragment_ok.t0000644000175000017500000000116712510570631020653 0ustar fsfsuse warnings; use strict; require 't/LintTest.pl'; # This test passes the HTML into html_ok, which expects a fully-formed # HTML document. checkit( [ [ 'elem-img-alt-missing' => 'Set #1 (4:5) does not have ALT text defined' ], [ 'doc-tag-required' => 'Set #1 (6:1) tag is required' ], [ 'doc-tag-required' => 'Set #1 (6:1) tag is required' ], [ 'doc-tag-required' => 'Set #1 (6:1) tag is required' ], ], [<DATA>] ); __DATA__ <body> <p> This is a valid fragment, but an incomplete document. <img src="alpha.jpg" height="21" width="12"> </p> </body> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������libhtml-lint-perl-2.22+dfsg.orig/t/30-test-builder.t������������������������������������������������0000644�0001750�0001750�00000000416�12510570631�017732� 0����������������������������������������������������������������������������������������������������ustar �fs������������������������������fs���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!perl -Tw use warnings; use strict; # The test is not that html_ok() works, but that the tests=>1 gets # acts as it should. use Test::HTML::Lint tests=>1; my $chunk = '<html><head></head><body><title>A fine chunk of code'; html_ok( $chunk ); libhtml-lint-perl-2.22+dfsg.orig/t/elem-unclosed.t0000644000175000017500000000065512506561573017662 0ustar fsfsuse warnings; use strict; require 't/LintTest.pl'; checkit( [ [ 'elem-unclosed' => qr/\Q at (6:5) is never closed/i ], [ 'elem-unclosed' => qr/\Q at (7:5) is never closed/i ], ], [] ); __DATA__ Test stuff

This is my paragraph

This is another paragraph

libhtml-lint-perl-2.22+dfsg.orig/t/pod.t0000644000175000017500000000021512506561573015700 0ustar fsfs#!perl -Tw use Test::More; eval "use Test::Pod 1.14"; plan skip_all => "Test::Pod 1.14 required for testing POD" if $@; all_pod_files_ok(); libhtml-lint-perl-2.22+dfsg.orig/t/elem-nonrepeatable.t0000644000175000017500000000055712506561573020666 0ustar fsfsuse warnings; use strict; require 't/LintTest.pl'; checkit( [ [ 'elem-nonrepeatable' => qr/ is not repeatable, but already appeared at \(3:2\)/i ], ], [<DATA>] ); __DATA__ <HTML> <HEAD> <TITLE>Test stuff As if one title isn't enough

This is my paragraph

libhtml-lint-perl-2.22+dfsg.orig/t/20-error-types-skip.t0000644000175000017500000000303112506561573020573 0ustar fsfs#!perl -Tw use strict; use warnings; use Test::More tests => 10; BEGIN { use_ok( 'HTML::Lint' ); } BEGIN { use_ok( 'HTML::Lint::Error', ':types' ); } my $text = do { local $/ = undef; }; FUNC_METHOD: { my $lint = HTML::Lint->new(); isa_ok( $lint, 'HTML::Lint' ); $lint->parse( $text ); is( scalar $lint->errors, 1, 'One error with a clean lint' ); $lint->newfile(); $lint->clear_errors(); $lint->only_types( HELPER, FLUFF ); $lint->parse( $text ); is( scalar $lint->errors, 0, 'No errors if helper & fluff' ); $lint->newfile(); $lint->clear_errors(); $lint->only_types( STRUCTURE ); $lint->parse( $text ); my @errors = $lint->errors; if ( !is( scalar @errors, 1, 'One error if we specify STRUCTURE if we turn it off' ) ) { diag( $_->as_string ) for @errors; } } CONSTRUCTOR_METHOD_SCALAR: { my $lint = HTML::Lint->new( only_types => STRUCTURE ); isa_ok( $lint, 'HTML::Lint' ); $lint->parse( $text ); my @errors = $lint->errors; if ( !is( scalar @errors, 1, 'One error if we specify STRUCTURE if we turn it off' ) ) { diag( $_->as_string ) for @errors; } } CONSTRUCTOR_METHOD_ARRAYREF: { my $lint = HTML::Lint->new( only_types => [HELPER, FLUFF] ); isa_ok( $lint, 'HTML::Lint' ); $lint->parse( $text ); is( scalar $lint->errors, 0, 'No errors if helper & fluff' ); } __DATA__ Test stuff This is my paragraph libhtml-lint-perl-2.22+dfsg.orig/t/10-test-html-lint.t0000644000175000017500000000053212510570631020211 0ustar fsfs#!perl -Tw use warnings; use strict; use Test::More tests => 3; use Test::HTML::Lint; BEGIN { use_ok( 'Test::HTML::Lint' ); } my $chunk = 'A fine chunk of code'; TODO: { # undef should fail local $TODO = "This test should NOT succeed"; html_ok( undef ); } html_ok( $chunk ); libhtml-lint-perl-2.22+dfsg.orig/t/20-error-types.t0000644000175000017500000000101312506561573017625 0ustar fsfs#!perl -Tw use warnings; use strict; use Test::More tests => 5; BEGIN { use_ok( 'HTML::Lint::Error' ); } my $err = HTML::Lint::Error->new( undef, undef, undef, 'elem-empty-but-closed' ); ok( $err->is_type( HTML::Lint::Error::STRUCTURE ) ); ok( !$err->is_type( HTML::Lint::Error::FLUFF, HTML::Lint::Error::HELPER ) ); $err = HTML::Lint::Error->new( undef, undef, undef, 'attr-unknown' ); ok( $err->is_type( HTML::Lint::Error::FLUFF ) ); ok( !$err->is_type( HTML::Lint::Error::STRUCTURE, HTML::Lint::Error::HELPER ) ); libhtml-lint-perl-2.22+dfsg.orig/t/02-versions.t0000644000175000017500000000063212506561573017210 0ustar fsfs#!perl -Tw use warnings; use strict; use Test::More tests => 5; BEGIN { use_ok( 'HTML::Lint::Parser' ); } BEGIN { use_ok( 'HTML::Lint' ); } BEGIN { use_ok( 'Test::HTML::Lint' ); } is( $HTML::Lint::VERSION, $Test::HTML::Lint::VERSION, 'HTML::Lint and Test::HTML::Lint versions match' ); is( $HTML::Lint::VERSION, $HTML::Lint::Parser::VERSION, 'HTML::Lint and Test::HTML::Lint versions match' ); libhtml-lint-perl-2.22+dfsg.orig/t/elem-img-sizes-missing.t0000644000175000017500000000112412506561573021414 0ustar fsfsuse warnings; use strict; require 't/LintTest.pl'; checkit( [ [ 'elem-img-sizes-missing' => qr/\Q tag has no HEIGHT and WIDTH attributes/i ], [ 'elem-img-sizes-missing' => qr/\Q tag has no HEIGHT and WIDTH attributes/i ], ], [] ); __DATA__ Test stuff

This is my paragraph

Bork! Bork! Bork! libhtml-lint-perl-2.22+dfsg.orig/t/xhtml-html.t0000644000175000017500000000225112506561573017216 0ustar fsfsuse warnings; use strict; require 't/LintTest.pl'; checkit( [ ], [] ); __DATA__ Test stuff This test brought to you by Mötley Crüe.

        Blah blah blah

        Now listen up
        She's razor sharp
        If she don't get her way
        She'll slice you apart
        Now she's cool cool black
        Moves like a cat
        If you don't get her game
        You might not make it back

        (Pre chorus)
        She's got the look's that kill
        That kill
        She's got the look's that kill
        That kill




        (Chorus)
        She's got the looks that kill

        Now she's bullet proof
        Keeps her motor clean
        And believe me you
        She's a number thirteen
        The church strikes midnight
        She's lookin' louder and louder
        She's gonna turn on your juice, boy
        So she turns on the power

        (Pre-chorus)
        She's got the looks that kill

        (Chorus)(Solo)(Verse)(Pre-chorus)(Chorus)
        
libhtml-lint-perl-2.22+dfsg.orig/t/elem-empty-but-closed.t0000644000175000017500000000047712506561573021245 0ustar fsfsuse warnings; use strict; require 't/LintTest.pl'; checkit( [ [ 'elem-empty-but-closed' => qr/
is not a container -- <\/hr> is not allowed/ ], ], [] ); __DATA__ Test stuff
This is a bad paragraph libhtml-lint-perl-2.22+dfsg.orig/t/11-test-html-lint-overload.t0000644000175000017500000000070212506561573022034 0ustar fsfs#!perl -Tw use strict; use warnings; use Test::More tests => 4; BEGIN { use_ok( 'Test::HTML::Lint' ); } BEGIN { use_ok( 'HTML::Lint' ); } BEGIN { use_ok( 'HTML::Lint::Error' ); } my $lint = HTML::Lint->new(); $lint->only_types( HTML::Lint::Error::FLUFF ); # This code is invalid, but the linter should ignore it my $chunk = << 'END';

This is a fine chunk of code

END html_ok( $lint, $chunk, 'STRUCTUREally naughty code passed' ); libhtml-lint-perl-2.22+dfsg.orig/t/text-unknown-entity.t0000644000175000017500000000137312506561573021117 0ustar fsfs#!perl use warnings; use strict; require 't/LintTest.pl'; checkit( [ [ 'text-unknown-entity' => qr/Entity &metalhorns; is unknown/ ], ], [] ); __DATA__ Ace of ♠: A tribute to Motörhead. ® &metalhorns; Thanks for visiting Ace of ♠

Here's an awesome link to "You Better Swim" from the SpongeBob movie. libhtml-lint-perl-2.22+dfsg.orig/t/20-error-types-export.t0000644000175000017500000000064312506561573021154 0ustar fsfs#!perl -Tw use warnings; use strict; use Test::More tests => 5; BEGIN { use_ok( 'HTML::Lint::Error', ':types' ); } my $err = HTML::Lint::Error->new( undef, undef, undef, 'elem-empty-but-closed' ); ok( $err->is_type( STRUCTURE ) ); ok( !$err->is_type( FLUFF, HELPER ) ); $err = HTML::Lint::Error->new( undef, undef, undef, 'attr-unknown' ); ok( $err->is_type( FLUFF ) ); ok( !$err->is_type( STRUCTURE, HELPER ) ); libhtml-lint-perl-2.22+dfsg.orig/t/elem-input-alt-missing.t0000644000175000017500000000215712510570631021417 0ustar fsfsuse warnings; use strict; require 't/LintTest.pl'; checkit( [ [ 'elem-input-alt-missing' => qr/ does not have non-blank ALT text defined/i ], [ 'elem-input-alt-missing' => qr/ does not have non-blank ALT text defined/i ], [ 'elem-input-alt-missing' => qr/ does not have non-blank ALT text defined/i ], [ 'elem-input-alt-missing' => qr/ does not have non-blank ALT text defined/i ], ], [] ); __DATA__ Test stuff

This is my paragraph

libhtml-lint-perl-2.22+dfsg.orig/t/attr-unknown.t0000644000175000017500000000073412507334721017565 0ustar fsfsuse warnings; use strict; require 't/LintTest.pl'; checkit( [ [ 'attr-unknown' => qr/Unknown attribute "FOOD" for tag

/i ], [ 'attr-unknown' => qr/Unknown attribute "Yummy" for tag /i ], ], [] ); __DATA__ Test stuff

This is my paragraph about burritos

This is my paragraph about refried beans libhtml-lint-perl-2.22+dfsg.orig/t/00-load.t0000644000175000017500000000027512506561573016260 0ustar fsfs#!perl -Tw use Test::More tests => 2; BEGIN { use_ok( 'HTML::Lint' ); } BEGIN { use_ok( 'Test::HTML::Lint' ); } diag( "Testing HTML::Lint $HTML::Lint::VERSION, Perl $], $^X" ); libhtml-lint-perl-2.22+dfsg.orig/t/40-where.t0000644000175000017500000000213012506561573016447 0ustar fsfs#!perl -Tw use warnings; use strict; use Test::More tests => 4; BEGIN { use_ok( 'HTML::Lint' ); } my $lint = HTML::Lint->new(); isa_ok( $lint, "HTML::Lint" ); $lint->parse( '' ); my @errors = $lint->errors; my $error = shift @errors; is( $error->as_string, " (1:1) with no opening ", "Got expected error" ); is( scalar @errors, 0, "No more errors" ); __DATA__ This doesn't test the error finding as much as the where() method. It fixes the following bug: Date: Mon, 22 Dec 2003 22:07:54 -0800 From: Adam Monsen To: Andy Lester Subject: HTML::Lint::Error bug The following demonstrates a bug in HTML::Lint that is seen when an offending tag is flush left ... use HTML::Lint; my $lint = HTML::Lint->new(); $lint->parse(''); warn $_->as_string."\n" for $lint->errors; The warning I'm getting looks like this: Argument "" isn't numeric in addition (+) at /usr/lib/perl5/site_perl/5.8.1/HTML/Lint/Error.pm line 176. If I change the parse() call as follows (by adding a leading space): $lint->parse(' '); the warning disappears. libhtml-lint-perl-2.22+dfsg.orig/t/01-coverage.t0000644000175000017500000000063612506561573017136 0ustar fsfs#!perl -Tw # This test verifies that there is a t/*.t file for every possible Lint error. use Test::More 'no_plan'; BEGIN { use_ok( 'HTML::Lint::Error' ); } my @errors = do { no warnings; keys %HTML::Lint::Error::errors }; isnt( scalar @errors, 0, 'There are at least some errors to be found.' ); for my $error ( @errors ) { my $filename = "t/$error.t"; ok( -e $filename, "$filename exists" ); } libhtml-lint-perl-2.22+dfsg.orig/t/random-nobr.t0000644000175000017500000000062012506561573017334 0ustar fsfsuse warnings; use strict; require 't/LintTest.pl'; checkit( [ [ 'elem-unknown' => qr/unknown element /i ], [ 'elem-unclosed' => qr/ at \(\d+:\d+\) is never closed/i ], ], [] ); __DATA__ Test stuff NOBR is fine with me! But Donky is not libhtml-lint-perl-2.22+dfsg.orig/t/pod-coverage.t0000644000175000017500000000030712506561573017473 0ustar fsfs#!perl -Tw use warnings; use strict; use Test::More; eval "use Test::Pod::Coverage 1.04"; plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@; all_pod_coverage_ok(); libhtml-lint-perl-2.22+dfsg.orig/t/text-use-entity.t0000644000175000017500000000254212506561573020213 0ustar fsfsuse warnings; use strict; require 't/LintTest.pl'; checkit( [ [ 'text-use-entity' => qr/Character "\\x0B" should be written as / ], [ 'text-use-entity' => qr/Character "\\xF1" should be written as ñ/ ], [ 'text-use-entity' => qr/Character "&" should be written as &/ ], [ 'text-use-entity' => qr/Character "&" should be written as &/ ], [ 'text-unclosed-entity' => qr/Entity ö is missing its closing semicolon/ ], ], [] ); __DATA__ Test stuff Here's a non-entityable char [ ].

We'll get to it maņana, which should really have an ñ.

Who wants a peanut butter & jelly? Motörhead does! They love rock & roll!

Here's an awesome link to "You Better Swim" from the SpongeBob movie.

libhtml-lint-perl-2.22+dfsg.orig/lib/0000755000175000017500000000000012510570712015224 5ustar fsfslibhtml-lint-perl-2.22+dfsg.orig/lib/Test/0000755000175000017500000000000012510570712016143 5ustar fsfslibhtml-lint-perl-2.22+dfsg.orig/lib/Test/HTML/0000755000175000017500000000000012510570712016707 5ustar fsfslibhtml-lint-perl-2.22+dfsg.orig/lib/Test/HTML/Lint.pm0000644000175000017500000001205412510570631020155 0ustar fsfspackage Test::HTML::Lint; use warnings; use strict; use Test::Builder; use Exporter; use HTML::Lint; use vars qw( @ISA $VERSION @EXPORT ); @ISA = qw( HTML::Parser Exporter ); =head1 NAME Test::HTML::Lint - Test::More-style wrapper around HTML::Lint =head1 VERSION Version 2.22 =cut $VERSION = '2.22'; my $Tester = Test::Builder->new; =head1 SYNOPSIS use Test::HTML::Lint tests => 4; my $table = build_display_table(); html_ok( $table, 'Built display table properly' ); =head1 DESCRIPTION This module provides a few convenience methods for testing exception based code. It is built with L and plays happily with L and friends. If you are not already familiar with L now would be the time to go take a look. =head1 EXPORT C =cut @EXPORT = qw( html_ok html_fragment_ok ); sub import { my $self = shift; my $pack = caller; $Tester->exported_to($pack); $Tester->plan(@_); $self->export_to_level(1, $self, @EXPORT); return; } =head2 html_ok( [$lint, ] $html, $name ) Checks to see if C<$html> is a valid HTML document, including checks for having C<< >>, C<< >>, C<< > >> and C<< <body> >> tags. If you're checking something that is only a fragment of an HTML document, use C<html_fragment_ok()>. If you pass an HTML::Lint object, C<html_ok()> will use that for its settings. my $lint = new HTML::Lint( only_types => STRUCTURE ); html_ok( $lint, $content, "Web page passes structural tests only" ); Otherwise, it will use the default rules. html_ok( $content, "Web page passes ALL tests" ); Note that if you pass in your own HTML::Lint object, C<html_ok()> will clear its errors before using it. =cut sub html_ok { my $lint; if ( ref($_[0]) eq 'HTML::Lint' ) { $lint = shift; $lint->newfile(); $lint->clear_errors(); } else { $lint = HTML::Lint->new; } my $html = shift; my $name = shift; my $ok = defined $html; if ( !$ok ) { $Tester->ok( 0, $name ); } else { $lint->parse( $html ); $lint->eof(); my $nerr = scalar $lint->errors; $ok = !$nerr; $Tester->ok( $ok, $name ); if ( !$ok ) { my $msg = 'Errors:'; $msg .= " $name" if $name; $Tester->diag( $msg ); $Tester->diag( $_->as_string ) for $lint->errors; } } return $ok; } =head2 html_fragment_ok( [$lint, ] $html, $name ) Checks that C<$fragment> is valid HTML, but not necessarily a valid HTML document. For example, this is a valid fragment, but not a valid HTML document: <body> <p>Lorem ipsum</p> </body> because it doesn't contain C<< <html> >> and C<< <head> >> tags. If you want to check that it is a valid document, use C<html_ok()>. If you pass an HTML::Lint object, C<html_fragment_ok()> will use that for its settings. my $lint = new HTML::Lint( only_types => STRUCTURE ); html_fragment_ok( $lint, $content, 'Web page passes structural tests only' ); Otherwise, it will use the default rules. html_fragment_ok( $content, 'Fragment passes ALL tests' ); Note that if you pass in your own HTML::Lint object, C<html_fragment_ok()> will clear its errors before using it. =cut sub html_fragment_ok { my $lint; if ( ref($_[0]) eq 'HTML::Lint' ) { $lint = shift; $lint->newfile(); $lint->clear_errors(); } else { $lint = HTML::Lint->new; } my $html = shift; my $name = shift; my $ok = defined $html; if ( !$ok ) { $Tester->ok( 0, $name ); } else { $lint->parse( $html ); my $nerr = scalar $lint->errors; $ok = !$nerr; $Tester->ok( $ok, $name ); if ( !$ok ) { my $msg = 'Errors:'; $msg .= " $name" if $name; $Tester->diag( $msg ); $Tester->diag( $_->as_string ) for $lint->errors; } } return $ok; } =head1 BUGS All bugs and requests are now being handled through GitHub. https://github.com/petdance/html-lint/issues DO NOT send bug reports to http://rt.cpan.org/ or http://code.google.com/ =head1 TO DO There needs to be a C<html_table_ok()> to check that the HTML is a self-contained, well-formed table, and then a comparable one for C<html_page_ok()>. If you think this module should do something that it doesn't do at the moment please let me know. =head1 ACKNOWLEDGEMENTS Thanks to chromatic and Michael G Schwern for the excellent Test::Builder, without which this module wouldn't be possible. Thanks to Adrian Howard for writing Test::Exception, from which most of this module is taken. =head1 COPYRIGHT & LICENSE Copyright 2005-2015 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. =head1 AUTHOR Andy Lester, C<andy@petdance.com> =cut 1; ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������libhtml-lint-perl-2.22+dfsg.orig/lib/HTML/����������������������������������������������������������0000755�0001750�0001750�00000000000�12510570712�015770� 5����������������������������������������������������������������������������������������������������ustar �fs������������������������������fs���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������libhtml-lint-perl-2.22+dfsg.orig/lib/HTML/Lint/�����������������������������������������������������0000755�0001750�0001750�00000000000�12510570712�016676� 5����������������������������������������������������������������������������������������������������ustar �fs������������������������������fs���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������libhtml-lint-perl-2.22+dfsg.orig/lib/HTML/Lint/Error.pm���������������������������������������������0000644�0001750�0001750�00000024763�12510570631�020341� 0����������������������������������������������������������������������������������������������������ustar �fs������������������������������fs���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������package HTML::Lint::Error; use warnings; use strict; use base 'Exporter'; our @EXPORT = (); our @EXPORT_OK = qw( STRUCTURE HELPER FLUFF ); our %EXPORT_TAGS = ( types => [@EXPORT_OK] ); our %errors; =head1 NAME HTML::Lint::Error - Error object for the Lint functionality =head1 SYNOPSIS See L<HTML::Lint> for all the gory details. =head1 EXPORTS None. It's all object-based. =head1 METHODS Almost everything is an accessor. =head1 Error types: C<STRUCTURE>, C<HELPER>, C<FLUFF> Each error has a type. Note that these roughly, but not exactly, go from most severe to least severe. =over 4 =item * C<STRUCTURE> For problems that relate to the structural validity of the code. Examples: Unclosed <TABLE> tags, incorrect values for attributes, and repeated attributes. =item * C<HELPER> Helpers are notes that will help you with your HTML, or that will help the browser render the code better or faster. Example: Missing HEIGHT and WIDTH attributes in an IMG tag. =item * C<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. =back =cut use constant CONFIG => 1; use constant STRUCTURE => 2; use constant HELPER => 3; use constant FLUFF => 4; =head2 new() Create an object. It's not very exciting. =cut sub new { my $class = shift; my $file = shift; my $line = shift; my $column = shift; my $errcode = shift; my @errparms = @_; # Add an element that says what tag caused the error (B, TR, etc) # so that we can match 'em up down the road. my $self = { _file => $file, _line => $line, _column => $column, _errcode => $errcode, _errtext => undef, _type => undef, }; bless $self, $class; $self->_expand_error( $errcode, @errparms ); return $self; } sub _expand_error { my $self = shift; my $errcode = shift; my $specs = $errors{$errcode}; my $str; if ( $specs ) { ($str, $self->{_type}) = @{$specs}; } else { $str = "Unknown code: $errcode"; } while ( @_ ) { my $var = shift; my $val = shift; $str =~ s/\$\{$var\}/$val/g; } $self->{_errtext} = $str; return; } =head2 is_type( $type1 [, $type2 ] ) Tells if any of I<$type1>, I<$type2>... match the error's type. Returns the type that matched. if ( $err->is_type( HTML::Lint::Error::STRUCTURE ) ) {.... =cut sub is_type { my $self = shift; for my $matcher ( @_ ) { return $matcher if $matcher eq $self->type; } return; } =head2 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. =cut sub where { my $line; my $col; if ( not ref $_[0] ) { $line = shift; $col = shift; } else { my $self = shift; $line = $self->line; $col = $self->column; } $col ||= 0; return sprintf( '(%s:%s)', $line, $col + 1 ); } =head2 as_string() Returns a nicely-formatted string for printing out to stdout or some similar user thing. =cut sub as_string { my $self = shift; return sprintf( '%s %s %s', $self->file, $self->where, $self->errtext ); } =head2 file() Returns the filename of the error, as set by the caller. =head2 line() Returns the line number of the error. =head2 column() Returns the column number, starting from 0 =head2 errcode() Returns the HTML::Lint error code. Don't rely on this, because it will probably go away. =head2 errtext() Descriptive text of the error =head2 type() Type of the error =cut sub file { my $self = shift; return $self->{_file} || '' } sub line { my $self = shift; return $self->{_line} || '' } sub column { my $self = shift; return $self->{_column} || '' } sub errcode { my $self = shift; return $self->{_errcode} || '' } sub errtext { my $self = shift; return $self->{_errtext} || '' } sub type { my $self = shift; return $self->{_type} || '' } =head1 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. =cut %errors = ( 'config-unknown-directive' => ['Unknown directive "${directive}"', CONFIG], 'config-unknown-value' => ['Unknown value "${value}" for ${directive} directive', CONFIG], 'elem-empty-but-closed' => ['<${tag}> is not a container -- </${tag}> is not allowed', STRUCTURE], 'elem-img-alt-missing' => ['<img src="${src}"> does not have ALT text defined', HELPER], 'elem-img-sizes-missing' => ['<img src="${src}"> tag has no HEIGHT and WIDTH attributes', HELPER], 'elem-input-alt-missing' => ['<input name="${name}" type="image"> does not have non-blank ALT text defined', HELPER], 'elem-nonrepeatable' => ['<${tag}> is not repeatable, but already appeared at ${where}', STRUCTURE], 'elem-unclosed' => ['<${tag}> at ${where} is never closed', STRUCTURE], 'elem-unknown' => ['Unknown element <${tag}>', STRUCTURE], 'elem-unopened' => ['</${tag}> with no opening <${tag}>', STRUCTURE], 'doc-tag-required' => ['<${tag}> tag is required', STRUCTURE], 'attr-repeated' => ['${attr} attribute in <${tag}> is repeated', STRUCTURE], 'attr-unknown' => ['Unknown attribute "${attr}" for tag <${tag}>', FLUFF], 'text-invalid-entity' => ['Entity ${entity} is invalid', STRUCTURE], 'text-unclosed-entity' => ['Entity ${entity} is missing its closing semicolon', STRUCTURE], 'text-unknown-entity' => ['Entity ${entity} is unknown', STRUCTURE], 'text-use-entity' => ['Character "${char}" should be written as ${entity}', STRUCTURE], ); =head2 config-unknown-directive Unknown directive "DIRECTIVE" You specified a directive in a comment for HTML::Lint that it didn't recognize. =head2 config-unknown-value Unknown value "VALUE" for DIRECTIVE directive Directive values can only be "on", "off", "yes", "no", "true", "false", "0" and "1". =head2 elem-unknown HTML::Lint doesn't know recognize the tag. =head2 elem-unopened C<< </tag> >> with no opening C<< <tag> >>. =head2 elem-unclosed C<< <tag> >> at WHERE is never closed. =head2 elem-empty-but-closed C<< <tag> >> is not a container -- C<< </tag> >> is not allowed. =head2 elem-img-alt-missing C<< <img src="FILENAME.PNG"> >> does not have ALT text defined. =head2 elem-img-sizes-missing C<< <img src="FILENAME.PNG"> >> tag has no HEIGHT and WIDTH attributes. =head2 elem-nonrepeatable C<< <tag> >> is not repeatable, but already appeared at WHERE. =head2 doc-tag-required C<< <tag> >> tag is required. =head2 attr-repeated ATTR attribute in C<< <tag> >> is repeated. =head2 attr-unknown Unknown attribute "ATTR" for tag C<< <tag> >>. =head2 text-invalid-entity Entity ENTITY is invalid =head2 text-unclosed-entity Entity ENTITY is missing its closing semicolon =head2 text-unknown-entity Entity ENTITY is unknown =head2 text-use-entity Character "CHAR" should be written as ENTITY =head1 COPYRIGHT & LICENSE Copyright 2005-2015 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. =head1 AUTHOR Andy Lester, C<andy at petdance.com> =cut 1; # happy __DATA__ Errors that haven't been done yet. #elem-head-only <${tag}> can only appear in the <HEAD> element #elem-non-head-element <${tag}> cannot appear in the <HEAD> element #elem-obsolete <${tag}> is obsolete #elem-nested-element <${tag}> cannot be nested -- one is already opened at ${where} #elem-wrong-context Illegal context for <${tag}> -- must appear in <${othertag}> tag. #elem-heading-in-anchor <A> should be inside <${tag}>, not <${tag}> inside <A> #elem-head-missing No <HEAD> element found #elem-head-missing-title No <TITLE> in <HEAD> element #elem-img-sizes-incorrect <IMG> tag's HEIGHT and WIDTH attributes are incorrect. They should be ${correct}. #attr-missing <${tag}> is missing a "${attr}" attribute #comment-unclosed Unclosed comment #comment-markup Markup embedded in a comment can confuse some browsers #text-literal-metacharacter Metacharacter $char should be represented as "$otherchar" #text-title-length The HTML spec recommends that that <TITLE> be no more than 64 characters #text-markup Tag <${tag}> found in the <TITLE>, which will not be rendered properly. #elem-physical-markup <${tag}> is physical font markup. Use logical (such as <${othertag}>) instead. #elem-leading-whitespace <${tag}> should not have whitespace between "<" and "${tag}>" #'must-follow' => [ ENABLED, MC_ERROR, '<$argv[0]> must immediately follow <$argv[1]>', ], # 'empty-container' => [ ENABLED, MC_WARNING, 'empty container element <$argv[0]>.', ], # 'directory-index' => [ ENABLED, MC_WARNING, 'directory $argv[0] does not have an index file ($argv[1])', ], # 'attribute-delimiter' => [ ENABLED, MC_WARNING, 'use of \' for attribute value delimiter is not supported by all browsers (attribute $argv[0] of tag $argv[1])', ], # 'container-whitespace' => [ DISABLED, MC_WARNING, '$argv[0] whitespace in content of container element $argv[1]', ], # 'bad-text-context' => [ ENABLED, MC_ERROR, 'illegal context, <$argv[0]>, for text; should be in $argv[1].', ], # 'attribute-format' => [ ENABLED, MC_ERROR, 'illegal value for $argv[0] attribute of $argv[1] ($argv[2])', ], # 'quote-attribute-value' => [ ENABLED, MC_ERROR, 'value for attribute $argv[0] ($argv[1]) of element $argv[2] should be quoted (i.e. $argv[0]="$argv[1]")', ], # 'meta-in-pre' => [ ENABLED, MC_ERROR, 'you should use "$argv[0]" in place of "$argv[1]", even in a PRE element.', ], # 'implied-element' => [ ENABLED, MC_WARNING, 'saw <$argv[0]> element, but no <$argv[1]> element', ], # 'button-usemap' => [ ENABLED, MC_ERROR, 'illegal to associate an image map with IMG inside a BUTTON', ], �������������libhtml-lint-perl-2.22+dfsg.orig/lib/HTML/Lint/Parser.pm��������������������������������������������0000644�0001750�0001750�00000023746�12510570631�020504� 0����������������������������������������������������������������������������������������������������ustar �fs������������������������������fs���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������package HTML::Lint::Parser; use warnings; use strict; use HTML::Parser 3.20; use HTML::Tagset 3.03; use HTML::Lint::HTML4 qw( %isKnownAttribute %isRequired %isNonrepeatable %isObsolete ); use HTML::Entities qw( %char2entity ); use base 'HTML::Parser'; =head1 NAME HTML::Lint::Parser - Parser for HTML::Lint. No user-serviceable parts inside. =head1 VERSION Version 2.22 =cut our $VERSION = '2.22'; =head1 SYNOPSIS See L<HTML::Lint> for all the gory details. =head1 METHODS =head2 new( $gripe ) Constructor for the main parsing object. The I<$gripe> argument is a coderef to a function that can handle errors from the parser. It is only ever (so far) C<HTML::Lint::gripe()>. =cut sub new { my $class = shift; my $gripe = shift; my $self = HTML::Parser->new( api_version => 3, start_document_h => [ \&_start_document, 'self' ], end_document_h => [ \&_end_document, 'self,line,column' ], start_h => [ \&_start, 'self,tagname,line,column,@attr' ], end_h => [ \&_end, 'self,tagname,line,column,tokenpos,@attr' ], comment_h => [ \&_comment, 'self,tagname,line,column,text' ], text_h => [ \&_text, 'self,text' ], strict_names => 0, empty_element_tags => 1, ); bless $self, $class; $self->{_gripe} = $gripe; $self->{_stack} = []; $self->{_directives} = {}; return $self; } =head2 $parser->gripe( $errorcode, [ arg1=>val1, ...] ) Calls the passed-in gripe function. If a given directive has been set to turn off a given message, then the parent gripe never gets called. =cut sub gripe { my $self = shift; my $errorcode = shift; if ( $self->_displayable( $errorcode ) ) { $self->{_gripe}->( $errorcode, @_ ); } return; } sub _displayable { my $self = shift; my $errorcode = shift; my $directives = $self->{_directives}; if ( not defined $directives->{$errorcode} ) { return 1; } else { return $directives->{$errorcode}; } } sub _start_document { return; } sub _end_document { my ($self,$line,$column) = @_; for my $tag ( keys %isRequired ) { if ( !$self->{_first_seen}->{$tag} ) { $self->gripe( 'doc-tag-required', tag => $tag ); } } return; } sub _start { my ($self,$tag,$line,$column,@attr) = @_; $self->{_line} = $line; $self->{_column} = $column; my $validattr = $isKnownAttribute{ $tag }; if ( $validattr ) { my %seen; my $i = 0; while ( $i < @attr ) { my ($attr,$val) = @attr[$i++,$i++]; if ( $seen{$attr}++ ) { $self->gripe( 'attr-repeated', tag => $tag, attr => $attr ); } if ( !$validattr->{$attr} ) { $self->gripe( 'attr-unknown', tag => $tag, attr => $attr ); } } # while attribs } else { $self->gripe( 'elem-unknown', tag => $tag ); } $self->_element_push( $tag ) unless $HTML::Tagset::emptyElement{ $tag }; if ( my $where = $self->{_first_seen}{$tag} ) { if ( $isNonrepeatable{$tag} ) { $self->gripe( 'elem-nonrepeatable', tag => $tag, where => HTML::Lint::Error::where( @{$where} ) ); } } else { $self->{_first_seen}{$tag} = [$line,$column]; } # Call any other overloaded func my $tagfunc = "_start_$tag"; if ( $self->can($tagfunc) ) { $self->$tagfunc( $tag, @attr ); } return; } sub _text { my ($self,$text) = @_; while ( $text =~ /&(?![#0-9a-z])/ig ) { $self->gripe( 'text-use-entity', char => '&', entity => '&' ); } while ( $text =~ /([^\x09\x0A\x0D -~])/g ) { my $bad = $1; $self->gripe( 'text-use-entity', char => sprintf( '\x%02lX', ord($bad) ), entity => $char2entity{ $bad }, ); } if ( not $self->{_unclosed_entities_regex} ) { # Get Gisle's list my @entities = sort keys %HTML::Entities::entity2char; # Strip his semicolons s/;$// for @entities; # Build a regex my $entities = join( '|', @entities ); $self->{_unclosed_entities_regex} = qr/&($entities)(?!;)/; $self->{_entity_lookup} = { map { ($_,1) } @entities }; } while ( $text =~ m/$self->{_unclosed_entities_regex}/g ) { my $ent = $1; $self->gripe( 'text-unclosed-entity', entity => "&$ent;" ); } while ( $text =~ m/&([^;]+);/g ) { my $ent = $1; # Numeric entities are fine, if they're not too large. if ( $ent =~ /^#(\d+)$/ ) { if ( $1 > 65536 ) { $self->gripe( 'text-invalid-entity', entity => "&$ent;" ); } next; } # Hex entities are fine, if they're not too large. if ( $ent =~ /^#x([\dA-F]+)$/i ) { if ( length($1) > 4 ) { $self->gripe( 'text-invalid-entity', entity => "&$ent;" ); } next; } # If it's not a numeric entity, then check the lookup table. if ( !exists $self->{_entity_lookup}{$ent} ) { $self->gripe( 'text-unknown-entity', entity => "&$ent;" ); } } return; } sub _comment { my ($self,$tagname,$line,$column,$text) = @_; # Look for the html-lint directives if ( $tagname =~ m/^\s*html-lint\s*(.+)\s*$/ ) { my $text = $1; my @commands = split( /\s*,\s*/, $text ); for my $command ( @commands ) { my ($directive,$value) = split( /\s*:\s*/, $command, 2 ); _trim($_) for ($directive,$value); if ( ($directive ne 'all') && ( not exists $HTML::Lint::Error::errors{ $directive } ) ) { $self->gripe( 'config-unknown-directive', directive => $directive, where => HTML::Lint::Error::where($line,$column) ); next; } my $normalized_value = _normalize_value( $value ); if ( !defined($normalized_value) ) { $self->gripe( 'config-unknown-value', directive => $directive, value => $value, where => HTML::Lint::Error::where($line,$column) ); next; } if ( $directive eq 'all' ) { for my $err ( keys %HTML::Lint::Error::errors ) { $self->_set_directive( $err, $normalized_value ); } } else { $self->_set_directive( $directive, $normalized_value ); } } } return; } sub _set_directive { my $self = shift; my $which = shift; my $what = shift; $self->{_directives}{$which} = $what; return; } sub _normalize_value { my $what = shift; $what = _trim( $what ); return 1 if $what =~ /^(?:1|on|true)$/; return 0 if $what =~ /^(?:0|off|false)$/; return undef; } sub _trim { $_[0] =~ s/^\s+//; $_[0] =~ s/\s+$//; return $_[0]; } sub _end { my ($self,$tag,$line,$column,$tokenpos,@attr) = @_; $self->{_line} = $line; $self->{_column} = $column; if ( !$tokenpos ) { # This is a dummy end event for something like <img />. # Do nothing. } elsif ( $HTML::Tagset::emptyElement{ $tag } ) { $self->gripe( 'elem-empty-but-closed', tag => $tag ); } else { if ( $self->_in_context($tag) ) { my @leftovers = $self->_element_pop_back_to($tag); for ( @leftovers ) { my ($tag,$line,$col) = @{$_}; $self->gripe( 'elem-unclosed', tag => $tag, where => HTML::Lint::Error::where($line,$col) ) unless $HTML::Tagset::optionalEndTag{$tag}; } # for } else { $self->gripe( 'elem-unopened', tag => $tag ); } } # is empty element # Call any other overloaded func my $tagfunc = "_end_$tag"; if ( $self->can($tagfunc) ) { $self->$tagfunc( $tag, $line ); } return; } sub _element_push { my $self = shift; for ( @_ ) { push( @{$self->{_stack}}, [$_,$self->{_line},$self->{_column}] ); } # while return; } sub _find_tag_in_stack { my $self = shift; my $tag = shift; my $stack = $self->{_stack}; my $offset = @{$stack} - 1; while ( $offset >= 0 ) { if ( $stack->[$offset][0] eq $tag ) { return $offset; } --$offset; } # while return; } sub _element_pop_back_to { my $self = shift; my $tag = shift; my $offset = $self->_find_tag_in_stack($tag) or return; my @leftovers = splice( @{$self->{_stack}}, $offset + 1 ); pop @{$self->{_stack}}; return @leftovers; } sub _in_context { my $self = shift; my $tag = shift; my $offset = $self->_find_tag_in_stack($tag); return defined $offset; } # Overridden tag-specific stuff sub _start_img { my ($self,$tag,%attr) = @_; my ($h,$w,$src) = @attr{qw( height width src )}; if ( defined $h && defined $w ) { # Check sizes } else { $self->gripe( 'elem-img-sizes-missing', src=>$src ); } if ( not defined $attr{alt} ) { $self->gripe( 'elem-img-alt-missing', src=>$src ); } return; } sub _start_input { my ($self,$tag,%attr) = @_; my ($type,$alt) = @attr{qw( type alt )}; if ( lc($type) eq 'image' ) { my $ok = defined($alt); if ( $ok ) { $alt =~ s/^ +//; $alt =~ s/ +$//; $ok = ($alt ne ''); } if ( !$ok ) { my $name = $attr{name}; $name = '' unless defined $name; $self->gripe( 'elem-input-alt-missing', name => $name ); } } return; } 1; ��������������������������libhtml-lint-perl-2.22+dfsg.orig/lib/HTML/Lint/HTML4.pm���������������������������������������������0000644�0001750�0001750�00000021714�12510570631�020071� 0����������������������������������������������������������������������������������������������������ustar �fs������������������������������fs���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������package HTML::Lint::HTML4; use warnings; use strict; =head1 NAME HTML::Lint::HTML4 -- Rules for HTML 4 as used by HTML::Lint. =head1 SYNOPSIS Collection of tags and attributes for use by HTML::Lint. You can add your own tags and attributes if you like. # Add an attribute that your company uses. HTML::Lint::HTML4::add_attribute( 'body', 'proprietary-attribute' ); # Add the HTML 5 <canvas> tag. HTML::Lint::HTML4::add_tag( 'canvas' ); HTML::Lint::HTML4::add_attribute( 'canvas', $_ ) for qw( height width ); This must be done before HTML::Lint does any validation. Note also that this modifies a global table, and is not on a per-object basis. =cut use base 'Exporter'; our @EXPORT_OK = qw( %isKnownAttribute %isRequired %isNonrepeatable %isObsolete ); sub _hash { return { map { ($_ => 1) } @_ } } our @physical = qw( b big code i kbd s small strike sub sup tt u xmp ); our @content = qw( abbr acronym cite code dfn em kbd samp strong var ); our @core = qw( class id style title ); our @i18n = qw( dir lang ); our @events = qw( onclick ondblclick onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup ); our @std = (@core,@i18n,@events); our %isRequired = %{_hash( qw( html body head title ) )}; our %isNonrepeatable = %{_hash( qw( html head base title body isindex ))}; our %isObsolete = %{_hash( qw( listing plaintext xmp ) )}; # Some day I might do something with these. For now, they're just comments. sub _ie_only { return @_ } sub _ns_only { return @_ } our %isKnownAttribute = ( # All the physical markup has the same (map { $_=>_hash(@std) } (@physical, @content) ), a => _hash( @std, qw( accesskey charset coords href hreflang name onblur onfocus rel rev shape tabindex target type ) ), address => _hash( @std ), applet => _hash( @std ), area => _hash( @std, qw( accesskey alt coords href nohref onblur onfocus shape tabindex target ) ), base => _hash( qw( href target ) ), basefont => _hash( qw( color face id size ) ), bdo => _hash( @core, @i18n ), blockquote => _hash( @std, qw( cite ) ), body => _hash( @std, qw( alink background bgcolor link marginheight marginwidth onload onunload text vlink ), _ie_only( qw( bgproperties leftmargin topmargin ) ) ), br => _hash( @core, qw( clear ) ), button => _hash( @std, qw( accesskey disabled name onblur onfocus tabindex type value ) ), caption => _hash( @std, qw( align ) ), center => _hash( @std ), cite => _hash(), col => _hash( @std, qw( align char charoff span valign width ) ), colgroup => _hash( @std, qw( align char charoff span valign width ) ), del => _hash( @std, qw( cite datetime ) ), div => _hash( @std, qw( align ) ), dir => _hash( @std, qw( compact ) ), dd => _hash( @std ), dl => _hash( @std, qw( compact ) ), dt => _hash( @std ), embed => _hash( qw( align height hidden name palette quality play src units width ), _ns_only( qw( border hspace pluginspage type vspace ) ), ), fieldset => _hash( @std ), font => _hash( @core, @i18n, qw( color face size ) ), form => _hash( @std, qw( accept-charset action enctype method name onreset onsubmit target ) ), frame => _hash( @core, qw( frameborder longdesc marginheight marginwidth name noresize scrolling src ) ), frameset => _hash( @core, qw( cols onload onunload rows border bordercolor frameborder framespacing ) ), h1 => _hash( @std, qw( align ) ), h2 => _hash( @std, qw( align ) ), h3 => _hash( @std, qw( align ) ), h4 => _hash( @std, qw( align ) ), h5 => _hash( @std, qw( align ) ), h6 => _hash( @std, qw( align ) ), head => _hash( @i18n, qw( profile ) ), hr => _hash( @core, @events, qw( align noshade size width ) ), html => _hash( @i18n, qw( version xmlns xml:lang ) ), iframe => _hash( @core, qw( align frameborder height longdesc marginheight marginwidth name scrolling src width ) ), img => _hash( @std, qw( align alt border height hspace ismap longdesc name src usemap vspace width ) ), input => _hash( @std, qw( accept accesskey align alt border checked disabled maxlength name onblur onchange onfocus onselect readonly size src tabindex type usemap value ) ), ins => _hash( @std, qw( cite datetime ) ), isindex => _hash( @core, @i18n, qw( prompt ) ), label => _hash( @std, qw( accesskey for onblur onfocus ) ), legend => _hash( @std, qw( accesskey align ) ), li => _hash( @std, qw( type value ) ), 'link' => _hash( @std, qw( charset href hreflang media rel rev target type ) ), 'map' => _hash( @std, qw( name ) ), menu => _hash( @std, qw( compact ) ), meta => _hash( @i18n, qw( content http-equiv name scheme ) ), nobr => _hash( @std ), noframes => _hash( @std ), noscript => _hash( @std ), object => _hash( @std, qw( align archive border classid codebase codetype data declare height hspace name standby tabindex type usemap vspace width )), ol => _hash( @std, qw( compact start type ) ), optgroup => _hash( @std, qw( disabled label ) ), option => _hash( @std, qw( disabled label selected value ) ), p => _hash( @std, qw( align ) ), param => _hash( qw( id name type value valuetype ) ), plaintext => _hash(), pre => _hash( @std, qw( width ) ), q => _hash( @std, qw( cite ) ), script => _hash( qw( charset defer event for language src type ) ), 'select' => _hash( @std, qw( disabled multiple name onblur onchange onfocus size tabindex ) ), span => _hash( @std ), style => _hash( @i18n, qw( media title type ) ), table => _hash( @std, qw( align bgcolor border cellpadding cellspacing datapagesize frame rules summary width ), _ie_only( qw( background bordercolor bordercolordark bordercolorlight ) ), _ns_only( qw( bordercolor cols height hspace vspace ) ), ), tbody => _hash( @std, qw( align char charoff valign ) ), td => _hash( @std, qw( abbr align axis bgcolor char charoff colspan headers height nowrap rowspan scope valign width ), _ie_only( qw( background bordercolor bordercolordark bordercolorlight ) ), ), textarea => _hash( @std, qw( accesskey cols disabled name onblur onchange onfocus onselect readonly rows tabindex wrap ) ), th => _hash( @std, qw( abbr align axis bgcolor char charoff colspan headers height nowrap rowspan scope valign width ), _ie_only( qw( background bordercolor bordercolordark bordercolorlight ) ), ), thead => _hash( @std, qw( align char charoff valign ) ), tfoot => _hash( @std, qw( align char charoff valign ) ), title => _hash( @i18n ), tr => _hash( @std, qw( align bgcolor char charoff valign ), _ie_only( qw( bordercolor bordercolordark bordercolorlight nowrap ) ), _ns_only( qw( nowrap ) ), ), ul => _hash( @std, qw( compact type ) ), ); =head1 FUNCTIONS The functions below are very specifically not exported, and need to be called with a complete package reference, so as to remind the programmer that she is monkeying with the entire package. =head2 add_tag( $tag ); Adds a tag to the list of tags that HTML::Lint knows about. If you specify a tag that HTML::Lint already knows about, then nothing is changed. HTML::Lint::HTML4::add_tag( 'canvas' ); =cut sub add_tag { my $tag = shift; if ( !$isKnownAttribute{ $tag } ) { $isKnownAttribute{ $tag } = {}; } return; } =head2 add_attribute( $tag, $attribute ); Adds an attribute to a tag that HTML::Lint knows about. The tag must already be known to HTML::Lint or else this function will die. HTML::Lint::HTML4::add_attribute( 'canvas', $_ ) for qw( height width ); =cut sub add_attribute { my $tag = shift; my $attr = shift; my $attrs = $isKnownAttribute{ $tag } || die "Tag $tag is unknown"; $isKnownAttribute{ $tag }->{ $attr } = 1; return; } 1; __END__ =head1 AUTHOR Andy Lester C<andy at petdance.com> =head1 COPYRIGHT Copyright 2005-2015 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. =cut ����������������������������������������������������libhtml-lint-perl-2.22+dfsg.orig/lib/HTML/Lint.pm���������������������������������������������������0000644�0001750�0001750�00000020644�12510570631�017242� 0����������������������������������������������������������������������������������������������������ustar �fs������������������������������fs���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������package HTML::Lint; use warnings; use strict; use HTML::Lint::Error; use HTML::Lint::Parser (); use HTML::Entities (); =head1 NAME HTML::Lint - check for HTML errors in a string or file =head1 VERSION Version 2.22 =cut our $VERSION = '2.22'; =head1 SYNOPSIS my $lint = HTML::Lint->new; $lint->only_types( HTML::Lint::Error::STRUCTURE ); $lint->parse( $data ); $lint->parse_file( $filename ); my $error_count = $lint->errors; foreach my $error ( $lint->errors ) { print $error->as_string, "\n"; } HTML::Lint also comes with a wrapper program called F<weblint> that handles linting from the command line: $ weblint http://www.cnn.com/ http://www.cnn.com/ (395:83) <IMG SRC="spacer.gif"> tag has no HEIGHT and WIDTH attributes. http://www.cnn.com/ (395:83) <IMG SRC="goofus.gif"> does not have ALT text defined http://www.cnn.com/ (396:217) Unknown element <nobr> http://www.cnn.com/ (396:241) </nobr> with no opening <nobr> http://www.cnn.com/ (842:7) target attribute in <a> is repeated And finally, you can also get L<Apache::HTML::Lint> that passes any mod_perl-generated code through HTML::Lint and get it dumped into your Apache F<error_log>. [Mon Jun 3 14:03:31 2002] [warn] /foo.pl (1:45) </p> with no opening <p> [Mon Jun 3 14:03:31 2002] [warn] /foo.pl (1:49) Unknown element <gronk> [Mon Jun 3 14:03:31 2002] [warn] /foo.pl (1:56) Unknown attribute "x" for tag <table> =cut =head1 METHODS NOTE: Some of these methods mirror L<HTML::Parser>'s methods, but HTML::Lint is not a subclass of HTML::Parser. =head2 new() Create an HTML::Lint object, which inherits from HTML::Parser. You may pass the types of errors you want to check for in the C<only_types> parm. my $lint = HTML::Lint->new( only_types => HTML::Lint::Error::STRUCTURE ); If you want more than one, you must pass an arrayref: my $lint = HTML::Lint->new( only_types => [HTML::Lint::Error::STRUCTURE, HTML::Lint::Error::FLUFF] ); =cut sub new { my $class = shift; my %args = @_; my $self = { _errors => [], _types => [], }; bless $self, $class; if ( my $only = $args{only_types} ) { $self->only_types( ref $only eq 'ARRAY' ? @{$only} : $only ); delete $args{only_types}; } warn "Unknown argument $_\n" for keys %args; return $self; } =head2 $lint->parser() Returns the parser object for this object, creating one if necessary. =cut sub parser { my $self = shift; if ( not $self->{_parser} ) { $self->{_parser} = HTML::Lint::Parser->new( sub { $self->gripe( @_ ) } ); $self->{_parser}->ignore_elements( qw(script style) ); } return $self->{_parser}; } =head2 $lint->parse( $text ) =head2 $lint->parse( $code_ref ) Passes in a chunk of HTML to be linted, either as a piece of text, or a code reference. See L<HTML::Parser>'s C<parse_file> method for details. =cut sub parse { my $self = shift; return $self->parser->parse( @_ ); } =head2 $lint->parse_file( $file ) Analyzes HTML directly from a file. The C<$file> argument can be a filename, an open file handle, or a reference to an open file handle. See L<HTML::Parser>'s C<parse_file> method for details. =cut sub parse_file { my $self = shift; return $self->parser->parse_file( @_ ); } =head2 $lint->eof Signals the end of a block of text getting passed in. This must be called to make sure that all parsing is complete before looking at errors. Any parameters (and there shouldn't be any) are passed through to HTML::Parser's eof() method. =cut sub eof { my $self = shift; my $rc; my $parser = $self->parser; if ( $parser ) { $rc = $self->parser->eof(@_); delete $self->{_parser}; } return $rc; } =head2 $lint->errors() In list context, C<errors> returns all of the errors found in the parsed text. Each error is an object of the type L<HTML::Lint::Error>. In scalar context, it returns the number of errors found. =cut sub errors { my $self = shift; if ( wantarray ) { return @{$self->{_errors}}; } else { return scalar @{$self->{_errors}}; } } =head2 $lint->clear_errors() Clears the list of errors, in case you want to print and clear, print and clear. =cut sub clear_errors { my $self = shift; $self->{_errors} = []; return; } =head2 $lint->only_types( $type1[, $type2...] ) Specifies to only want errors of a certain type. $lint->only_types( HTML::Lint::Error::STRUCTURE ); Calling this without parameters makes the object return all possible errors. The error types are C<STRUCTURE>, C<HELPER> and C<FLUFF>. See L<HTML::Lint::Error> for details on these types. =cut sub only_types { my $self = shift; $self->{_types} = [@_]; return; } =head2 $lint->gripe( $errcode, [$key1=>$val1, ...] ) Adds an error message, in the form of an L<HTML::Lint::Error> object, to the list of error messages for the current object. The file, line and column are automatically passed to the L<HTML::Lint::Error> constructor, as well as whatever other key value pairs are passed. For example: $lint->gripe( 'attr-repeated', tag => $tag, attr => $attr ); Usually, the user of the object won't call this directly, but just in case, here you go. =cut sub gripe { my $self = shift; my $error = HTML::Lint::Error->new( $self->{_file}, $self->parser->{_line}, $self->parser->{_column}, @_ ); my @keeps = @{$self->{_types}}; if ( !@keeps || $error->is_type(@keeps) ) { push( @{$self->{_errors}}, $error ); } return; } =head2 $lint->newfile( $filename ) Call C<newfile()> whenever you switch to another file in a batch of linting. Otherwise, the object thinks everything is from the same file. Note that the list of errors is NOT cleared. Note that I<$filename> does NOT need to match what's put into parse() or parse_file(). It can be a description, a URL, or whatever. =cut sub newfile { my $self = shift; my $file = shift; delete $self->{_parser}; $self->{_file} = $file; $self->{_line} = 0; $self->{_column} = 0; $self->{_first_seen} = {}; return $self->{_file}; } # newfile 1; =head1 MODIFYING HTML::LINT'S BEHAVIOR Sometimes you'll have HTML that for some reason cannot conform to HTML::Lint's expectations. For those instances, you can use HTML comments to modify HTML::Lint's behavior. Say you have an image where for whatever reason you can't get dimensions for the image. This HTML snippet: <img src="logo.png" height="120" width="50" alt="Company logo"> <img src="that.png"> causes this error: foo.html (14:20) <img src="that.png"> tag has no HEIGHT and WIDTH attributes But if for some reason you can't get those dimensions when you build the page, you can at least stop HTML::Lint complaining about it. <img src="this.png" height="120" width="50" alt="Company logo"> <!-- html-lint elem-img-sizes-missing: off, elem-img-alt-missing: off --> <img src="that.png"> <!-- html-lint elem-img-sizes-missing: on, elem-img-alt-missing: off --> If you want to turn off all HTML::Lint warnings for a block of code, use <!-- html-lint all: off --> And turn them back on with <!-- html-lint all: off --> You don't have to use "on" and "off". For "on", you can use "true" or "1". For "off", you can use "0" or "false". For a list of possible errors and their codes, see L<HTML::Lint::Error>, or run F<perldoc HTML::Lint::Error>. =head1 BUGS, WISHES AND CORRESPONDENCE All bugs and requests are now being handled through GitHub. https://github.com/petdance/html-lint/issues DO NOT send bug reports to http://rt.cpan.org/ or http://code.google.com/ =head1 TODO =over 4 =item * Check for attributes that require values =item * <TABLE>s that have no rows. =item * Form fields that aren't in a FORM =item * Check for valid entities, and that they end with semicolons =item * DIVs with nothing in them. =item * HEIGHT= that have percents in them. =item * Check for goofy stuff like: <b><li></b><b>Hello Reader - Spanish Level 1 (K-3)</b> =back =head1 COPYRIGHT & LICENSE Copyright 2005-2015 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. =head1 AUTHOR Andy Lester, andy at petdance.com =cut 1; ��������������������������������������������������������������������������������������������libhtml-lint-perl-2.22+dfsg.orig/MANIFEST�����������������������������������������������������������0000644�0001750�0001750�00000002036�12545512032�015607� 0����������������������������������������������������������������������������������������������������ustar �fs������������������������������fs���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Changes MANIFEST Makefile.PL README bin/weblint lib/HTML/Lint.pm lib/HTML/Lint/Error.pm lib/HTML/Lint/HTML4.pm lib/HTML/Lint/Parser.pm lib/Test/HTML/Lint.pm t/LintTest.pl t/00-load.t t/01-coverage.t t/02-versions.t t/10-test-html-lint.t t/11-test-html-lint-overload.t t/12-html_fragment_ok.t t/20-error-types-export.t t/20-error-types-skip.t t/20-error-types.t t/30-test-builder.t t/40-where.t t/50-multiple-files.t t/60-add-tags.t t/attr-repeated.t t/attr-unknown.t t/config-unknown-directive.t t/config-unknown-value.t t/doc-tag-required.t t/elem-empty-but-closed.t t/elem-img-alt-missing.t t/elem-img-sizes-missing.t t/elem-input-alt-missing.t t/elem-nonrepeatable.t t/elem-unclosed.t t/elem-unknown.t t/elem-unopened.t t/pod-coverage.t t/pod.t t/random-nobr.t t/strong-id.t t/text-invalid-entity.t t/text-unclosed-entity.t t/text-unknown-entity.t t/text-use-entity.t t/xhtml-html.t META.yml Module YAML meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������libhtml-lint-perl-2.22+dfsg.orig/README�������������������������������������������������������������0000644�0001750�0001750�00000000570�12510570631�015340� 0����������������������������������������������������������������������������������������������������ustar �fs������������������������������fs���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������HTML::Lint is a pure-Perl HTML parser and checker for syntactic legitmacy. It supports only HTML 4. The "weblint" program that comes with HTML::Lint lets you lint a webpage or local files. For those of you doing automated testing with Test::More and the rest of the Perl testing framework, Test::HTML::Lint lets you automate HTML checking. Andy Lester andy at petdance.com ����������������������������������������������������������������������������������������������������������������������������������������libhtml-lint-perl-2.22+dfsg.orig/Changes������������������������������������������������������������0000644�0001750�0001750�00000006771�12510570631�015764� 0����������������������������������������������������������������������������������������������������ustar �fs������������������������������fs���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Revision history HTML::Lint and Test::HTML::Lint. NOTE: All bugs and requests are now being handled through GitHub. https://github.com/petdance/html-lint/issues Please DO NOT send bug reports to http://rt.cpan.org/. 2.22 Mon Apr 6 15:47:11 CDT 2015 [CHANGES THAT COULD BREAK YOUR CODE] Previously, html_ok() would not check the entire structure of a web page to check for <html>, <head>, <title> and <body> tags. Now it will. If you want to check fragments of HTML for validity but know that they are not valid HTML documents on their own, use the new html_fragment_ok(). [ENHANCEMENTS] Added new error, elem-input-alt-missing, that warns of <input type="image"> tags that are missing an alt="" attribute. This helps for accessability to make sure that any images have alternate text for screen readers. Added ability to modify HTML::Lint's table of known tags and attributes, so you could do this: # Add an attribute that your company uses. HTML::Lint::HTML4::add_attribute( 'body', 'proprietary-attribute' ); # Add the HTML 5 <canvas> tag. HTML::Lint::HTML4::add_tag( 'canvas' ); HTML::Lint::HTML4::add_attribute( 'canvas', $_ ) for qw( height width ); [FIXES] Test::HTML::Lint::html_ok() would not call the HTML::Lint eof() method, which meant it wouldn't do document-wide tests. 2.20 Fri Apr 6 00:49:51 CDT 2012 [ENHANCEMENTS] Sometimes creating HTML::Lint-compliant HTML just isn't possible. Now, you can now turn individual errors on and off in your HTML via comment directives, like so: <!-- html-lint elem-img-sizes-missing: off, attr-unknown: off --> And if you have a batch of code that's hopeless: <!-- html-lint all: off --> Added check for unknown entities, such as "&foo;". Added check for unclosed entitities, such as "&" without the closing semicolon. Added a check for a bare ampersand that should be written as & 2.10 Tue Dec 6 11:16:16 CST 2011 [FIXES] Tags that were self-closed were being ignored. For example, if you had <img src="blah.jpg" /> then HTML::Lint would ignore the tag. This has been fixed. [LICENSE] HTML::Lint is now explicitly licensed under Artistic License 2.0, instead of the vague "same terms as Perl itself." 2.06 Thu Dec 18 00:07:54 CST 2008 [FIXES] Added attributes to <frameset>. <strong> tag didn't allow any attributes. Now it does. Removed the <listing> tag. 2.04 Mon Jun 2 11:41:16 CDT 2008 [FIXES] <textarea> now knows about the wrap attribute. [INTERNALS] Lots of enhancements pointed out by Perl::Critic. 2.02 Thu Nov 3 11:49:18 CST 2005 [ENHANCEMENTS] * The warnings for missing ALT and HEIGHT/WIDTH on your images now give the SRC attribute. 2.00 Tue Sep 20 23:10:39 CDT 2005 [CHANGES THAT COULD BREAK YOUR CODE] * I've changed the object structure. HTML::Lint now has-a HTML::Parser, and no longer is-a HTML::Parser. * weblint-cgi and weblint-original are no longer distributed with HTML::Lint. * Now requires Perl 5.6.0. [FIXES] * Line numbering is now correct if you parse more than one file. * Changed t/*.*.t so that they only had one period in the filename. Apparently VMS doesn't like filenames with multiple dots. Pre-2.00 I've thrown away previous history because really, nobody cares what changed in this module prior to 2005. �������libhtml-lint-perl-2.22+dfsg.orig/bin/���������������������������������������������������������������0000755�0001750�0001750�00000000000�12510570712�015226� 5����������������������������������������������������������������������������������������������������ustar �fs������������������������������fs���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������libhtml-lint-perl-2.22+dfsg.orig/bin/weblint��������������������������������������������������������0000755�0001750�0001750�00000004633�12506561573�016640� 0����������������������������������������������������������������������������������������������������ustar �fs������������������������������fs���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/perl -w use warnings; use strict; use Getopt::Long; use HTML::Lint; use HTML::Lint::HTML4; my $help; my $context; my $structure = 1; my $helper = 1; my $fluff = 1; GetOptions( 'help' => \$help, 'context:i' => \$context, 'only' => sub { $structure = $helper = $fluff = 0; }, 'structure!' => \$structure, 'helper!' => \$helper, 'fluff!' => \$fluff, ) or $help = 1; if ( !@ARGV || $help ) { print "weblint v$HTML::Lint::VERSION\n"; print <DATA>; exit 1; } my @types; push( @types, HTML::Lint::Error::STRUCTURE ) if $structure; push( @types, HTML::Lint::Error::HELPER ) if $helper; push( @types, HTML::Lint::Error::FLUFF ) if $fluff; my $lint = HTML::Lint->new; $lint->only_types( @types ) if @types; for my $url ( @ARGV ) { my @lines; $lint->newfile( $url ); if ( $url =~ /^https?:/ ) { eval { require LWP::Simple }; if ( $@ ) { warn q{Can't retrieve URLs without LWP::Simple installed}; next; } my $content = LWP::Simple::get( $url ); if ( $content ) { @lines = split( /\n/, $content ); $_ = "$_\n" for @lines; } else { warn "Unable to fetch $url\n"; next; } } else { open( my $fh, '<', $url ) or die "Can't open $url: $!"; @lines = <$fh>; close $fh or die $!; } $lint->parse( $_ ) for @lines; $lint->eof(); for my $error ( $lint->errors() ) { print $error->as_string(), "\n"; if ( defined $context ) { $context += 0; my $lineno = $error->line - 1; my $start = $lineno-$context; $start = 0 if $start < 0; my $end = $lineno+$context; $end = $#lines if $end > $#lines; print " $_\n" for @lines[$start..$end]; print "\n"; } } $lint->clear_errors(); } # for files __END__ Usage: weblint [filename or url]... (filename - reads STDIN) --help This message --context[=n] Show the offending line (and n surrounding lines) Error types: (default: all on) --[no]structure Structural issues, like unclosed tag pairs --[no]helper Helper issues, like missing HEIGHT & WIDTH --[no]fluff Fluff that can be removed, like bad tag attributes --only Turns off all other error types, as in --only --fluff �����������������������������������������������������������������������������������������������������libhtml-lint-perl-2.22+dfsg.orig/Makefile.PL��������������������������������������������������������0000644�0001750�0001750�00000004772�12506561573�016454� 0����������������������������������������������������������������������������������������������������ustar �fs������������������������������fs���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������use strict; use warnings; use ExtUtils::MakeMaker qw( WriteMakefile ); use 5.006001; if ( not eval { require LWP::Simple; 1; } ) { print <<'EOF'; NOTE: It seems that you don't have LWP::Simple installed. The weblint program will not be able to retrieve web pages. EOF } my %parms = ( NAME => 'HTML::Lint', DISTNAME => 'HTML-Lint', VERSION_FROM => 'lib/HTML/Lint.pm', ABSTRACT_FROM => 'lib/HTML/Lint.pm', PMLIBDIRS => [qw(lib/)], AUTHOR => 'Andy Lester <andy@petdance.com>', PREREQ_PM => { 'Exporter' => 0, 'Test::More' => 0, 'Test::Builder' => 0, 'File::Find' => 0, 'HTML::Entities' => 0, 'HTML::Parser' => '3.47', 'HTML::Tagset' => '3.03', }, EXE_FILES => [qw(bin/weblint)], dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, clean => { FILES => 'HTML-Lint-*' }, ); if ( $ExtUtils::MakeMaker::VERSION =~ /^\d[.]\d\d$/ and $ExtUtils::MakeMaker::VERSION > 6.30 ) { $parms{LICENSE} = 'artistic_2'; } if ( $ExtUtils::MakeMaker::VERSION ge '6.46' ) { $parms{META_ADD} = { resources => { homepage => 'http://search.cpan.org/dist/html-lint', bugtracker => 'https://github.com/petdance/html-lint/issues', license => 'http://www.opensource.org/licenses/artistic-license-2.0.php', repository => 'https://github.com/petdance/html-lint', } }; } WriteMakefile( %parms ); sub MY::postamble { my $postamble = <<'MAKE_FRAG'; .PHONY: tags critic tags: ctags -f tags --recurse --totals \ --exclude=blib \ --exclude=.svn \ --exclude='*~' \ --languages=Perl --langmap=Perl:+.t \ critic: perlcritic -1 -q -profile perlcriticrc lib/ bin/weblint Makefile.PL PROF_ARGS = -Mblib blib/script/weblint index.html timed: all $(PERL) $(PROF_ARGS) >> /dev/null 2>&1 dprof: all $(PERL) -d:DProf $(PROF_ARGS) >> /dev/null 2>&1 dprofpp -R dproflb: all $(PERL) -d:DProfLB $(PROF_ARGS) >> /dev/null 2>&1 dprofpp -R fastprof: all $(PERL) -d:FastProf $(PROF_ARGS) >> /dev/null 2>&1 fprofpp profile: all $(PERL) -d:Profile $(PROF_ARGS) >> /dev/null 2>&1 less prof.out profiler: all $(PERL) -MDevel::Profiler $(PROF_ARGS) >> /dev/null 2>&1 dprofpp -R smallprof: all $(PERL) -d:SmallProf $(PROF_ARGS) >> /dev/null 2>&1 sort -k 2nr,2 smallprof.out | less nytprof: all $(PERL) -d:NYTProf $(PROF_ARGS) >> /dev/null 2>&1 nytprofhtml MAKE_FRAG return $postamble; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������