r22267 - in /trunk/libhtml-lint-perl: Changes META.yml Makefile.PL bin/weblint debian/changelog lib/HTML/Lint.pm lib/HTML/Lint/Error.pm lib/HTML/Lint/HTML4.pm lib/Test/HTML/Lint.pm

js at users.alioth.debian.org js at users.alioth.debian.org
Sat Jun 28 17:17:37 UTC 2008


Author: js
Date: Sat Jun 28 17:17:37 2008
New Revision: 22267

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=22267
Log:
New upstream release.

Modified:
    trunk/libhtml-lint-perl/Changes
    trunk/libhtml-lint-perl/META.yml
    trunk/libhtml-lint-perl/Makefile.PL
    trunk/libhtml-lint-perl/bin/weblint
    trunk/libhtml-lint-perl/debian/changelog
    trunk/libhtml-lint-perl/lib/HTML/Lint.pm
    trunk/libhtml-lint-perl/lib/HTML/Lint/Error.pm
    trunk/libhtml-lint-perl/lib/HTML/Lint/HTML4.pm
    trunk/libhtml-lint-perl/lib/Test/HTML/Lint.pm

Modified: trunk/libhtml-lint-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-lint-perl/Changes?rev=22267&op=diff
==============================================================================
--- trunk/libhtml-lint-perl/Changes (original)
+++ trunk/libhtml-lint-perl/Changes Sat Jun 28 17:17:37 2008
@@ -1,4 +1,16 @@
 Revision history HTML::Lint and Test::HTML::Lint.
+
+NOTE: All bugs and requests are now being handled through the Google
+Code issue tracker at http://code.google.com/p/html-lint/issues/list.
+DO NOT send bug reports to http://rt.cpan.org/
+
+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]

Modified: trunk/libhtml-lint-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-lint-perl/META.yml?rev=22267&op=diff
==============================================================================
--- trunk/libhtml-lint-perl/META.yml (original)
+++ trunk/libhtml-lint-perl/META.yml Sat Jun 28 17:17:37 2008
@@ -1,16 +1,24 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
-name:         HTML-Lint
-version:      2.02
-version_from: lib/HTML/Lint.pm
-installdirs:  site
-requires:
+--- #YAML:1.0
+name:                HTML-Lint
+version:             2.04
+abstract:            check for HTML errors in a string or file
+license:             perl
+author:              
+    - Andy Lester <andy at petdance.com>
+generated_by:        ExtUtils::MakeMaker version 6.44
+distribution_type:   module
+requires:     
     Exporter:                      0
     File::Find:                    0
     HTML::Parser:                  3.20
     HTML::Tagset:                  3.03
     Test::Builder:                 0
     Test::More:                    0
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.30
+meta-spec:
+    url:     http://module-build.sourceforge.net/META-spec-v1.3.html
+    version: 1.3
+resources:
+    homepage: http://search.cpan.org/dist/html-lint
+    bugtracker: http://code.google.com/p/html-lint/issues/list
+    license: http://dev.perl.org/licenses/
+    Repository: http://code.google.com/p/html-lint/source

Modified: trunk/libhtml-lint-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-lint-perl/Makefile.PL?rev=22267&op=diff
==============================================================================
--- trunk/libhtml-lint-perl/Makefile.PL (original)
+++ trunk/libhtml-lint-perl/Makefile.PL Sat Jun 28 17:17:37 2008
@@ -1,14 +1,6 @@
 use strict;
-use ExtUtils::MakeMaker;
-use File::Find;
-use 5.6.0;
-
-find( \&filecheck, "." );
-
-sub filecheck {
-    unlink if /~$/;     # Remove any vi backup files
-    die "Aborting: Swapfile $_ found" if /\.swp$/;
-}
+use ExtUtils::MakeMaker qw( WriteMakefile );
+use 5.006001;
 
 eval { require LWP::Simple; };
 
@@ -21,7 +13,7 @@
 EOF
 }
 
-&WriteMakefile(
+my %parms = (
     NAME            => 'HTML::Lint',
     DISTNAME        => 'HTML-Lint',
     VERSION_FROM    => 'lib/HTML/Lint.pm',
@@ -38,9 +30,77 @@
     },
     EXE_FILES   => [qw(bin/weblint)],
     dist => {
-        COMPRESS => 'gzip -9f', 
+        COMPRESS => 'gzip -9f',
         SUFFIX => 'gz',
     },
     clean => { FILES => 'HTML-Lint-*' },
-    );
+);
 
+if ( $ExtUtils::MakeMaker::VERSION =~ /^\d\.\d\d$/ and $ExtUtils::MakeMaker::VERSION > 6.30 ) {
+    $parms{LICENSE} = 'perl';
+}
+
+if ( $ExtUtils::MakeMaker::VERSION ge '6.36' ) {
+    $parms{EXTRA_META} = <<EOF;
+resources:
+    homepage: http://search.cpan.org/dist/html-lint
+    bugtracker: http://code.google.com/p/html-lint/issues/list
+    license: http://dev.perl.org/licenses/
+    Repository: http://code.google.com/p/html-lint/source
+EOF
+    }
+
+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 bin/weblint lib/
+
+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;
+}

Modified: trunk/libhtml-lint-perl/bin/weblint
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-lint-perl/bin/weblint?rev=22267&op=diff
==============================================================================
--- trunk/libhtml-lint-perl/bin/weblint (original)
+++ trunk/libhtml-lint-perl/bin/weblint Sat Jun 28 17:17:37 2008
@@ -1,6 +1,6 @@
-#!/usr/bin/perl -wT
-# $Id: weblint,v 1.14 2002/08/05 22:03:24 petdance Exp $
+#!/usr/bin/perl -w
 
+use warnings;
 use strict;
 
 use Getopt::Long;
@@ -15,12 +15,12 @@
 my $fluff     = 1;
 
 GetOptions(
-    "help"	    => \$help,
-    "context:i"	    => \$context,
-    "only"	    => sub { $structure = $helper = $fluff = 0; },
-    "structure!"    => \$structure,
-    "helper!"	    => \$helper,
-    "fluff!"	    => \$fluff,
+    'help'       => \$help,
+    'context:i'  => \$context,
+    'only'       => sub { $structure = $helper = $fluff = 0; },
+    'structure!' => \$structure,
+    'helper!'    => \$helper,
+    'fluff!'     => \$fluff,
 ) or $help = 1;
 
 if ( !@ARGV || $help ) {
@@ -30,9 +30,9 @@
 }
 
 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;
+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 = new HTML::Lint;
 $lint->only_types( @types ) if @types;
@@ -40,54 +40,56 @@
     my @lines;
     $lint->newfile( $url );
     if ( $url =~ /^https?:/ ) {
-	eval { require LWP::Simple };
-	if ( $@ ) {
-	    warn "Can't retrieve URLs without LWP::Simple installed";
-	    next;
-	}
+        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;
+        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;
     }
     $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;
+        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 $start = $lineno-$context;
+            $start = 0 if $start < 0;
 
-	    my $end = $lineno+$context;
-	    $end = $#lines if $end > $#lines;
+            my $end = $lineno+$context;
+            $end = $#lines if $end > $#lines;
 
-	    print "    $_\n" for @lines[$start..$end];
-	    print "\n";
-	}
+            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
+    --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
+    --[no]fluff     Fluff that can be removed, like bad tag attributes
+    --only          Turns off all other error types, as in --only --fluff
 

Modified: trunk/libhtml-lint-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-lint-perl/debian/changelog?rev=22267&op=diff
==============================================================================
--- trunk/libhtml-lint-perl/debian/changelog (original)
+++ trunk/libhtml-lint-perl/debian/changelog Sat Jun 28 17:17:37 2008
@@ -1,3 +1,9 @@
+libhtml-lint-perl (2.04-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- Jonas Smedegaard <dr at jones.dk>  Sat, 28 Jun 2008 19:10:39 +0200
+
 libhtml-lint-perl (2.02-3) unstable; urgency=medium
 
   [ Jonas Smedegaard ]

Modified: trunk/libhtml-lint-perl/lib/HTML/Lint.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-lint-perl/lib/HTML/Lint.pm?rev=22267&op=diff
==============================================================================
--- trunk/libhtml-lint-perl/lib/HTML/Lint.pm (original)
+++ trunk/libhtml-lint-perl/lib/HTML/Lint.pm Sat Jun 28 17:17:37 2008
@@ -1,16 +1,21 @@
 package HTML::Lint;
 
+use warnings;
+use strict;
+
+use HTML::Lint::Error;
+
 =head1 NAME
 
 HTML::Lint - check for HTML errors in a string or file
 
 =head1 VERSION
 
-Version 2.02
-
-=cut
-
-our $VERSION = '2.02';
+Version 2.04
+
+=cut
+
+our $VERSION = '2.04';
 
 =head1 SYNOPSIS
 
@@ -46,9 +51,6 @@
 
 =cut
 
-use strict;
-use HTML::Lint::Error;
-
 =head1 METHODS
 
 NOTE: Some of these methods mirror L<HTML::Parser>'s methods, but HTML::Lint
@@ -64,7 +66,7 @@
 
 If you want more than one, you must pass an arrayref:
 
-    my $lint = HTML::Lint->new( 
+    my $lint = HTML::Lint->new(
         only_types => [HTML::Lint::Error::STRUCTURE, HTML::Lint::Error::FLUFF] );
 
 =cut
@@ -81,7 +83,7 @@
     bless $self, $class;
 
     if ( my $only = $args{only_types} ) {
-        $self->only_types( ref $only eq "ARRAY" ? @$only : $only );
+        $self->only_types( ref $only eq 'ARRAY' ? @{$only} : $only );
         delete $args{only_types};
     }
 
@@ -171,6 +173,8 @@
     my $self = shift;
 
     $self->{_errors} = [];
+
+    return;
 }
 
 =head2 $lint->only_types( $type1[, $type2...] )
@@ -225,9 +229,9 @@
 
 =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.
+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.
@@ -268,7 +272,7 @@
 use HTML::Lint::HTML4 qw( %isKnownAttribute %isRequired %isNonrepeatable %isObsolete );
 use HTML::Entities qw( %char2entity );
 
-our @ISA = qw( HTML::Parser );
+use base 'HTML::Parser';
 
 sub new {
     my $class = shift;
@@ -299,7 +303,6 @@
 }
 
 sub _start_document {
-    my $self = shift;
 }
 
 sub _end_document {
@@ -310,6 +313,8 @@
             $self->gripe( 'doc-tag-required', tag => $tag );
         }
     }
+
+    return;
 }
 
 sub _start {
@@ -342,7 +347,7 @@
         if ( $isNonrepeatable{$tag} ) {
             $self->gripe( 'elem-nonrepeatable',
                             tag => $tag,
-                            where => HTML::Lint::Error::where(@$where)
+                            where => HTML::Lint::Error::where( @{$where} )
                         );
         }
     }
@@ -355,6 +360,8 @@
     if ( $self->can($tagfunc) ) {
         $self->$tagfunc( $tag, @attr );
     }
+
+    return;
 }
 
 sub _text {
@@ -363,11 +370,13 @@
     while ( $text =~ /([^\x09\x0A\x0D -~])/g ) {
         my $bad = $1;
         $self->gripe(
-            'text-use-entity', 
+            'text-use-entity',
                 char => sprintf( '\x%02lX', ord($bad) ),
                 entity => $char2entity{ $bad },
         );
     }
+
+    return;
 }
 
 sub _end {
@@ -383,8 +392,8 @@
         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, 
+                my ($tag,$line,$col) = @{$_};
+                $self->gripe( 'elem-unclosed', tag => $tag,
                         where => HTML::Lint::Error::where($line,$col) )
                         unless $HTML::Tagset::optionalEndTag{$tag};
             } # for
@@ -399,6 +408,8 @@
     if ( $self->can($tagfunc) ) {
         $self->$tagfunc( $tag, $line );
     }
+
+    return;
 }
 
 sub _element_push {
@@ -406,6 +417,8 @@
     for ( @_ ) {
         push( @{$self->{_stack}}, [$_,$self->{_line},$self->{_column}] );
     } # while
+
+    return;
 }
 
 sub _find_tag_in_stack {
@@ -413,7 +426,7 @@
     my $tag = shift;
     my $stack = $self->{_stack};
 
-    my $offset = @$stack - 1;
+    my $offset = @{$stack} - 1;
     while ( $offset >= 0 ) {
         if ( $stack->[$offset][0] eq $tag ) {
             return $offset;
@@ -453,22 +466,20 @@
         # Check sizes
     }
     else {
-        $self->gripe( "elem-img-sizes-missing", src=>$src );
+        $self->gripe( 'elem-img-sizes-missing', src=>$src );
     }
     if ( not defined $attr{alt} ) {
-        $self->gripe( "elem-img-alt-missing", src=>$src );
-    }
+        $self->gripe( 'elem-img-alt-missing', src=>$src );
+    }
+
+    return;
 }
 
 =head1 BUGS, WISHES AND CORRESPONDENCE
 
-Please feel free to email me at andy at petdance.com.  I'm glad to help as
-best I can, and I'm always interested in bugs, suggestions and patches.
-
-Please report any bugs or feature requests to
-C<< <bug-html-lint at rt.cpan.org> >>, or through the web interface at
-L<http://rt.cpan.org>.  I will be notified, and then you'll automatically
-be notified of progress on your bug as I make changes.
+All bugs and requests are now being handled through the Google
+Code issue tracker at http://code.google.com/p/html-lint/issues/list.
+DO NOT send bug reports to http://rt.cpan.org/
 
 =head1 TODO
 
@@ -494,7 +505,7 @@
 
 =head1 LICENSE
 
-Copyright 2005 Andy Lester, All Rights Reserved.
+Copyright 2005-2008 Andy Lester, All Rights Reserved.
 
 This program is free software; you can redistribute it and/or modify it
 under the same terms as Perl itself.
@@ -508,3 +519,4 @@
 
 =cut
 
+1;

Modified: trunk/libhtml-lint-perl/lib/HTML/Lint/Error.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-lint-perl/lib/HTML/Lint/Error.pm?rev=22267&op=diff
==============================================================================
--- trunk/libhtml-lint-perl/lib/HTML/Lint/Error.pm (original)
+++ trunk/libhtml-lint-perl/lib/HTML/Lint/Error.pm Sat Jun 28 17:17:37 2008
@@ -1,8 +1,10 @@
 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] );
@@ -98,7 +100,7 @@
     my $specs = $errors{$errcode};
     my $str;
     if ( $specs ) {
-        ($str, $self->{_type}) = @$specs;
+        ($str, $self->{_type}) = @{$specs};
     }
     else {
         $str = "Unknown code: $errcode";
@@ -170,7 +172,7 @@
         $col = $self->column;
     }
     $col ||= 0;
-    return sprintf( "(%s:%s)", $line, $col + 1 );
+    return sprintf( '(%s:%s)', $line, $col + 1 );
 }
 
 =head2 as_string()
@@ -182,7 +184,7 @@
 sub as_string {
     my $self = shift;
 
-    return sprintf( "%s %s %s", $self->file, $self->where, $self->errtext );
+    return sprintf( '%s %s %s', $self->file, $self->where, $self->errtext );
 }
 
 =head2 file()

Modified: trunk/libhtml-lint-perl/lib/HTML/Lint/HTML4.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-lint-perl/lib/HTML/Lint/HTML4.pm?rev=22267&op=diff
==============================================================================
--- trunk/libhtml-lint-perl/lib/HTML/Lint/HTML4.pm (original)
+++ trunk/libhtml-lint-perl/lib/HTML/Lint/HTML4.pm Sat Jun 28 17:17:37 2008
@@ -1,11 +1,12 @@
 package HTML::Lint::HTML4;
 
+use warnings;
 use strict;
 
 use base 'Exporter';
 our @EXPORT_OK = qw( %isKnownAttribute %isRequired %isNonrepeatable %isObsolete );
 
-sub _hash(@) { my %hash; $hash{$_} = 1 for @_; return \%hash; }
+sub _hash   { my %hash; @hash{@_} = (1) x scalar @_; return \%hash; }
 
 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 );
@@ -111,7 +112,7 @@
                     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 ) ),
+    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 ) ),

Modified: trunk/libhtml-lint-perl/lib/Test/HTML/Lint.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-lint-perl/lib/Test/HTML/Lint.pm?rev=22267&op=diff
==============================================================================
--- trunk/libhtml-lint-perl/lib/Test/HTML/Lint.pm (original)
+++ trunk/libhtml-lint-perl/lib/Test/HTML/Lint.pm Sat Jun 28 17:17:37 2008
@@ -1,11 +1,12 @@
 package Test::HTML::Lint;
 
+use warnings;
 use strict;
 
 use Test::Builder;
 use Exporter;
 
-use HTML::Lint 2.02;
+use HTML::Lint 2.04;
 
 use vars qw( @ISA $VERSION @EXPORT );
 
@@ -17,11 +18,11 @@
 
 =head1 VERSION
 
-Version 2.02
+Version 2.04
 
 =cut
 
-$VERSION = '2.02';
+$VERSION = '2.04';
 
 my $Tester = Test::Builder->new;
 
@@ -57,6 +58,8 @@
     $Tester->plan(@_);
 
     $self->export_to_level(1, $self, @EXPORT);
+
+    return;
 }
 
 =head2 html_ok( [$lint, ] $html, $name )
@@ -84,30 +87,32 @@
 sub html_ok {
     my $lint;
 
-    if ( ref($_[0]) eq "HTML::Lint" ) {
-	$lint = shift;
-	$lint->newfile();
-	$lint->clear_errors();
-    } else {
-	$lint = HTML::Lint->new;
+    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( 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;
-	}
+        if ( !$ok ) {
+            my $msg = 'Errors:';
+            $msg .= " $name" if $name;
+            $Tester->diag( $msg );
+            $Tester->diag( $_->as_string ) for $lint->errors;
+        }
     }
 
     return $ok;
@@ -115,10 +120,9 @@
 
 =head1 BUGS
 
-Please report any bugs or feature requests to C<bug-html-lint at rt.cpan.org>,
-or through the web interface at L<http://rt.cpan.org>.  I will be
-notified, and then you'll automatically be notified of progress on
-your bug as I make changes.
+All bugs and requests are now being handled through the Google
+Code issue tracker at http://code.google.com/p/html-lint/issues/list.
+DO NOT send bug reports to http://rt.cpan.org/
 
 =head1 TO DO
 
@@ -139,7 +143,7 @@
 
 =head1 LICENSE
 
-Copyright 2003 Andy Lester, All Rights Reserved.
+Copyright 2003-2008 Andy Lester, All Rights Reserved.
 
 This program is free software; you can redistribute it and/or modify it
 under the same terms as Perl itself.




More information about the Pkg-perl-cvs-commits mailing list