.
[Mon Jun 3 14:03:31 2002] [warn] /foo.pl (1:45) with no opening
[Mon Jun 3 14:03:31 2002] [warn] /foo.pl (1:49) Unknown element
[Mon Jun 3 14:03:31 2002] [warn] /foo.pl (1:56) Unknown attribute "x" for tag
=cut
=head1 METHODS
NOTE: Some of these methods mirror L'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 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's C 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's C 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 returns all of the errors found in the
parsed text. Each error is an object of the type L.
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, C and C.
See L 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 object,
to the list of error messages for the current object. The file,
line and column are automatically passed to the L
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 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:
causes this error:
foo.html (14:20)
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.
If you want to turn off all HTML::Lint warnings for a block of code, use
And turn them back on with
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,
or run F.
=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 * 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:
Hello Reader - Spanish Level 1 (K-3)
=back
=head1 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
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.20+dfsg.orig/META.json 0000644 0001750 0001750 00000002640 11737502061 016101 0 ustar fs fs {
"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.120630",
"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"
],
"x_Repository" : "https://github.com/petdance/html-lint"
},
"version" : "2.20"
}
libhtml-lint-perl-2.20+dfsg.orig/bin/ 0000755 0001750 0001750 00000000000 11740121252 015217 5 ustar fs fs libhtml-lint-perl-2.20+dfsg.orig/bin/weblint 0000755 0001750 0001750 00000004633 11737475356 016646 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 ;
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.20+dfsg.orig/t/ 0000755 0001750 0001750 00000000000 11740121252 014712 5 ustar fs fs libhtml-lint-perl-2.20+dfsg.orig/t/elem-img-sizes-missing.t 0000644 0001750 0001750 00000001124 11737460432 021407 0 ustar fs fs use 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
libhtml-lint-perl-2.20+dfsg.orig/t/elem-img-alt-missing.t 0000644 0001750 0001750 00000000606 11737460432 021036 0 ustar fs fs use 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.20+dfsg.orig/t/00-load.t 0000644 0001750 0001750 00000000275 11737460432 016253 0 ustar fs fs #!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.20+dfsg.orig/t/50-multiple-files.t 0000644 0001750 0001750 00000001752 11737460432 020275 0 ustar fs fs use 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.20+dfsg.orig/t/10-test-html-lint.t 0000644 0001750 0001750 00000000521 11737460432 020214 0 ustar fs fs #!perl -Tw
use warnings;
use strict;
use Test::More tests => 4;
use Test::HTML::Lint;
BEGIN {
use_ok( 'Test::HTML::Lint' );
}
my $chunk = "This is a fine chunk of code
";
TODO: { # undef should fail
local $TODO = "This test should NOT succeed";
html_ok( undef );
}
html_ok( '' ); # Blank is OK
html_ok( $chunk );
libhtml-lint-perl-2.20+dfsg.orig/t/pod-coverage.t 0000644 0001750 0001750 00000000307 11737460432 017466 0 ustar fs fs #!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.20+dfsg.orig/t/11-test-html-lint-overload.t 0000644 0001750 0001750 00000000702 11737460432 022027 0 ustar fs fs #!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.20+dfsg.orig/t/elem-unclosed.t 0000644 0001750 0001750 00000000655 11737460432 017655 0 ustar fs fs use 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.20+dfsg.orig/t/text-invalid-entity.t 0000644 0001750 0001750 00000003065 11737460432 021041 0 ustar fs fs #!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.20+dfsg.orig/t/20-error-types.t 0000644 0001750 0001750 00000001013 11737460432 017620 0 ustar fs fs #!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.20+dfsg.orig/t/40-where.t 0000644 0001750 0001750 00000002130 11737460432 016442 0 ustar fs fs #!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.20+dfsg.orig/t/20-error-types-export.t 0000644 0001750 0001750 00000000643 11737460432 021147 0 ustar fs fs #!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.20+dfsg.orig/t/30-test-builder.t 0000644 0001750 0001750 00000000347 11737460432 017742 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 = "This is a fine chunk of code
";
html_ok( $chunk );
libhtml-lint-perl-2.20+dfsg.orig/t/02-versions.t 0000644 0001750 0001750 00000000632 11737462412 017203 0 ustar fs fs #!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.20+dfsg.orig/t/strong-id.t 0000644 0001750 0001750 00000001643 11737460432 017025 0 ustar fs fs use 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.20+dfsg.orig/t/elem-nonrepeatable.t 0000644 0001750 0001750 00000000557 11737460432 020661 0 ustar fs fs use warnings;
use strict;
require 't/LintTest.pl';
checkit( [
[ 'elem-nonrepeatable' => qr/ is not repeatable, but already appeared at \(3:2\)/i ],
], [] );
__DATA__
Test stuff
As if one title isn't enough
This is my paragraph
libhtml-lint-perl-2.20+dfsg.orig/t/text-unknown-entity.t 0000644 0001750 0001750 00000001373 11737460432 021112 0 ustar fs fs #!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.20+dfsg.orig/t/LintTest.pl 0000644 0001750 0001750 00000003122 11737460432 017027 0 ustar fs fs use 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.20+dfsg.orig/t/doc-tag-required.t 0000644 0001750 0001750 00000000442 11737460432 020247 0 ustar fs fs use 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.20+dfsg.orig/t/config-unknown-directive.t 0000644 0001750 0001750 00000000740 11737460432 022032 0 ustar fs fs use 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.20+dfsg.orig/t/text-unclosed-entity.t 0000644 0001750 0001750 00000001554 11737460432 021230 0 ustar fs fs #!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.20+dfsg.orig/t/random-nobr.t 0000644 0001750 0001750 00000000620 11737460432 017327 0 ustar fs fs use 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.20+dfsg.orig/t/20-error-types-skip.t 0000644 0001750 0001750 00000003031 11737460432 020566 0 ustar fs fs #!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.20+dfsg.orig/t/pod.t 0000644 0001750 0001750 00000000215 11737460432 015673 0 ustar fs fs #!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.20+dfsg.orig/t/elem-empty-but-closed.t 0000644 0001750 0001750 00000000477 11737460432 021240 0 ustar fs fs use 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.20+dfsg.orig/t/attr-repeated.t 0000644 0001750 0001750 00000000474 11737460432 017661 0 ustar fs fs use 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.20+dfsg.orig/t/text-use-entity.t 0000644 0001750 0001750 00000002542 11737460432 020206 0 ustar fs fs use 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.20+dfsg.orig/t/config-unknown-value.t 0000644 0001750 0001750 00000001245 11737460432 021171 0 ustar fs fs use 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.20+dfsg.orig/t/elem-unknown.t 0000644 0001750 0001750 00000000733 11737460432 017535 0 ustar fs fs use 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
libhtml-lint-perl-2.20+dfsg.orig/t/xhtml-html.t 0000644 0001750 0001750 00000002251 11737460432 017211 0 ustar fs fs use 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.20+dfsg.orig/t/attr-unknown.t 0000644 0001750 0001750 00000000734 11737460432 017566 0 ustar fs fs use 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.20+dfsg.orig/t/01-coverage.t 0000644 0001750 0001750 00000000636 11737460432 017131 0 ustar fs fs #!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.20+dfsg.orig/t/elem-unopened.t 0000644 0001750 0001750 00000000460 11737460432 017650 0 ustar fs fs use 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.20+dfsg.orig/MANIFEST 0000644 0001750 0001750 00000001733 11740121252 015604 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/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/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-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.20+dfsg.orig/META.yml 0000644 0001750 0001750 00000001533 11737502061 015731 0 ustar fs fs ---
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.120630'
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
x_Repository: https://github.com/petdance/html-lint
version: 2.20
libhtml-lint-perl-2.20+dfsg.orig/Makefile.PL 0000644 0001750 0001750 00000004772 11737475303 016452 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 ',
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;
}