Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package perl-HTML-Parser for openSUSE:Factory checked in at 2022-03-24 22:57:12 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-HTML-Parser (Old) and /work/SRC/openSUSE:Factory/.perl-HTML-Parser.new.1900 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-HTML-Parser" Thu Mar 24 22:57:12 2022 rev:36 rq:964293 version:3.77 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-HTML-Parser/perl-HTML-Parser.changes 2021-03-12 13:31:06.854140230 +0100 +++ /work/SRC/openSUSE:Factory/.perl-HTML-Parser.new.1900/perl-HTML-Parser.changes 2022-03-24 22:57:31.892223374 +0100 @@ -1,0 +2,9 @@ +Tue Mar 15 03:06:59 UTC 2022 - Tina M??ller <timueller+p...@suse.de> + +- updated to 3.77 + see /usr/share/doc/packages/perl-HTML-Parser/Changes + + 3.77 2022-03-14 + * Update tests to remove HTML4 specific tags (GH#25) (Jess) + +------------------------------------------------------------------- Old: ---- HTML-Parser-3.76.tar.gz New: ---- HTML-Parser-3.77.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-HTML-Parser.spec ++++++ --- /var/tmp/diff_new_pack.rcwCSx/_old 2022-03-24 22:57:32.972224416 +0100 +++ /var/tmp/diff_new_pack.rcwCSx/_new 2022-03-24 22:57:32.976224420 +0100 @@ -1,7 +1,7 @@ # # spec file for package perl-HTML-Parser # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,15 +18,16 @@ %define cpan_name HTML-Parser Name: perl-HTML-Parser -Version: 3.76 +Version: 3.77 Release: 0 -Summary: HTML parser class License: Artistic-1.0 OR GPL-1.0-or-later +Summary: HTML parser class URL: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/O/OA/OALDERS/%{cpan_name}-%{version}.tar.gz Source1: cpanspec.yml BuildRequires: perl BuildRequires: perl-macros +BuildRequires: perl(ExtUtils::MakeMaker) >= 6.52 BuildRequires: perl(HTML::Tagset) BuildRequires: perl(HTTP::Headers) BuildRequires: perl(URI) ++++++ HTML-Parser-3.76.tar.gz -> HTML-Parser-3.77.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Parser-3.76/Changes new/HTML-Parser-3.77/Changes --- old/HTML-Parser-3.76/Changes 2021-03-04 19:05:46.000000000 +0100 +++ new/HTML-Parser-3.77/Changes 2022-03-14 23:11:58.000000000 +0100 @@ -1,5 +1,8 @@ Change history for HTML-Parser +3.77 2022-03-14 + * Update tests to remove HTML4 specific tags (GH#25) (Jess) + 3.76 2021-03-04 * Add a fix for a stack confusion error on `eof`. (GH#21) (Matthew Horsfall and Chase Whitener) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Parser-3.76/LICENSE new/HTML-Parser-3.77/LICENSE --- old/HTML-Parser-3.76/LICENSE 2021-03-04 19:05:46.000000000 +0100 +++ new/HTML-Parser-3.77/LICENSE 2022-03-14 23:11:58.000000000 +0100 @@ -292,21 +292,21 @@ - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through - textual modification. + textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright - Holder. + Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for - the package. + the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the - computing community at large as a market that must bear the fee.) + computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they - received it. + received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you @@ -373,7 +373,7 @@ 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF -MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Parser-3.76/MANIFEST new/HTML-Parser-3.77/MANIFEST --- old/HTML-Parser-3.76/MANIFEST 2021-03-04 19:05:46.000000000 +0100 +++ new/HTML-Parser-3.77/MANIFEST 2022-03-14 23:11:58.000000000 +0100 @@ -1,4 +1,4 @@ -# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.017. +# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.024. Changes LICENSE MANIFEST diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Parser-3.76/META.json new/HTML-Parser-3.77/META.json --- old/HTML-Parser-3.76/META.json 2021-03-04 19:05:46.000000000 +0100 +++ new/HTML-Parser-3.77/META.json 2022-03-14 23:11:58.000000000 +0100 @@ -4,7 +4,7 @@ "Gisle Aas <g...@cpan.org>" ], "dynamic_config" : 0, - "generated_by" : "Dist::Zilla version 6.017, CPAN::Meta::Converter version 2.150010", + "generated_by" : "Dist::Zilla version 6.024, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], @@ -90,32 +90,32 @@ "provides" : { "HTML::Entities" : { "file" : "lib/HTML/Entities.pm", - "version" : "3.76" + "version" : "3.77" }, "HTML::Filter" : { "file" : "lib/HTML/Filter.pm", - "version" : "3.76", + "version" : "3.77", "x_deprecated" : 1 }, "HTML::HeadParser" : { "file" : "lib/HTML/HeadParser.pm", - "version" : "3.76" + "version" : "3.77" }, "HTML::LinkExtor" : { "file" : "lib/HTML/LinkExtor.pm", - "version" : "3.76" + "version" : "3.77" }, "HTML::Parser" : { "file" : "lib/HTML/Parser.pm", - "version" : "3.76" + "version" : "3.77" }, "HTML::PullParser" : { "file" : "lib/HTML/PullParser.pm", - "version" : "3.76" + "version" : "3.77" }, "HTML::TokeParser" : { "file" : "lib/HTML/TokeParser.pm", - "version" : "3.76" + "version" : "3.77" } }, "release_status" : "stable", @@ -130,7 +130,7 @@ "web" : "https://github.com/libwww-perl/HTML-Parser" } }, - "version" : "3.76", + "version" : "3.77", "x_contributors" : [ "Antonio Radici <anto...@dyne.org>", "Barbie <bar...@missbarbell.co.uk>", @@ -142,6 +142,7 @@ "Fran\u00e7ois Perrad <francois.per...@gadz.org>", "Gisle Aas <gi...@aas.no>", "Jacques Germishuys <jacqu...@striata.com>", + "Jess Robinson <casta...@desert-island.me.uk>", "Jon Jensen <j...@endpoint.com>", "Mike South <mso...@gmail.com>", "Nicholas Clark <n...@ccl4.org>", @@ -153,8 +154,8 @@ "Yves Orton <demer...@gmail.com>", "Zefram <zef...@fysh.org>" ], - "x_generated_by_perl" : "v5.30.3", - "x_serialization_backend" : "Cpanel::JSON::XS version 4.19", + "x_generated_by_perl" : "v5.34.0", + "x_serialization_backend" : "Cpanel::JSON::XS version 4.27", "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Parser-3.76/META.yml new/HTML-Parser-3.77/META.yml --- old/HTML-Parser-3.76/META.yml 2021-03-04 19:05:46.000000000 +0100 +++ new/HTML-Parser-3.77/META.yml 2022-03-14 23:11:58.000000000 +0100 @@ -18,7 +18,7 @@ ExtUtils::MakeMaker: '6.52' perl: '5.008' dynamic_config: 0 -generated_by: 'Dist::Zilla version 6.017, CPAN::Meta::Converter version 2.150010' +generated_by: 'Dist::Zilla version 6.024, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -35,26 +35,26 @@ provides: HTML::Entities: file: lib/HTML/Entities.pm - version: '3.76' + version: '3.77' HTML::Filter: file: lib/HTML/Filter.pm - version: '3.76' + version: '3.77' x_deprecated: 1 HTML::HeadParser: file: lib/HTML/HeadParser.pm - version: '3.76' + version: '3.77' HTML::LinkExtor: file: lib/HTML/LinkExtor.pm - version: '3.76' + version: '3.77' HTML::Parser: file: lib/HTML/Parser.pm - version: '3.76' + version: '3.77' HTML::PullParser: file: lib/HTML/PullParser.pm - version: '3.76' + version: '3.77' HTML::TokeParser: file: lib/HTML/TokeParser.pm - version: '3.76' + version: '3.77' requires: Carp: '0' Exporter: '0' @@ -70,7 +70,7 @@ bugtracker: https://github.com/libwww-perl/HTML-Parser/issues homepage: https://github.com/libwww-perl/HTML-Parser repository: https://github.com/libwww-perl/HTML-Parser.git -version: '3.76' +version: '3.77' x_contributors: - 'Antonio Radici <anto...@dyne.org>' - 'Barbie <bar...@missbarbell.co.uk>' @@ -82,6 +82,7 @@ - 'Fran??ois Perrad <francois.per...@gadz.org>' - 'Gisle Aas <gi...@aas.no>' - 'Jacques Germishuys <jacqu...@striata.com>' + - 'Jess Robinson <casta...@desert-island.me.uk>' - 'Jon Jensen <j...@endpoint.com>' - 'Mike South <mso...@gmail.com>' - 'Nicholas Clark <n...@ccl4.org>' @@ -92,6 +93,6 @@ - 'Ville Skytt?? <ville.sky...@iki.fi>' - 'Yves Orton <demer...@gmail.com>' - 'Zefram <zef...@fysh.org>' -x_generated_by_perl: v5.30.3 +x_generated_by_perl: v5.34.0 x_serialization_backend: 'YAML::Tiny version 1.73' x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Parser-3.76/Makefile.PL new/HTML-Parser-3.77/Makefile.PL --- old/HTML-Parser-3.76/Makefile.PL 2021-03-04 19:05:46.000000000 +0100 +++ new/HTML-Parser-3.77/Makefile.PL 2022-03-14 23:11:58.000000000 +0100 @@ -1,5 +1,5 @@ # This Makefile.PL for HTML-Parser was generated by -# Dist::Zilla::Plugin::MakeMaker::Awesome 0.48. +# Dist::Zilla::Plugin::MakeMaker::Awesome 0.49. # Don't edit it but the dist.ini and plugins used to construct it. use strict; @@ -39,7 +39,7 @@ "URI" => 0, "strict" => 0 }, - "VERSION" => "3.76", + "VERSION" => "3.77", "test" => { "TESTS" => "t/*.t" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Parser-3.76/README new/HTML-Parser-3.77/README --- old/HTML-Parser-3.76/README 2021-03-04 19:05:46.000000000 +0100 +++ new/HTML-Parser-3.77/README 2022-03-14 23:11:58.000000000 +0100 @@ -2,30 +2,32 @@ HTML::Parser - HTML parser class SYNOPSIS - use strict; - use warnings; - use HTML::Parser (); - - # Create parser object - my $p = HTML::Parser->new( - api_version => 3, - start_h => [\&start, "tagname, attr"], - end_h => [\&end, "tagname"], - marked_sections => 1, - ); - - # Parse document text chunk by chunk - $p->parse($chunk1); - $p->parse($chunk2); - # ... - # signal end of document - $p->eof; - - # Parse directly from file - $p->parse_file("foo.html"); - # or - open(my $fh, "<:utf8", "foo.html") || die; - $p->parse_file($fh); + use strict; + use warnings; + use HTML::Parser (); + + # Create parser object + my $p = HTML::Parser->new( + api_version => 3, + start_h => [\&start, "tagname, attr"], + end_h => [\&end, "tagname"], + marked_sections => 1, + ); + + # Parse document text chunk by chunk + $p->parse($chunk1); + $p->parse($chunk2); + + # ... + # signal end of document + $p->eof; + + # Parse directly from file + $p->parse_file("foo.html"); + + # or + open(my $fh, "<:utf8", "foo.html") || die; + $p->parse_file($fh); DESCRIPTION Objects of the "HTML::Parser" class will recognize markup and separate @@ -128,14 +130,14 @@ The effect of this is the same as: - while (1) { - my $chunk = &$code_ref(); - if (!defined($chunk) || !length($chunk)) { - $p->eof; - return $p; + while (1) { + my $chunk = &$code_ref(); + if (!defined($chunk) || !length($chunk)) { + $p->eof; + return $p; + } + $p->parse($chunk) || return undef; } - $p->parse($chunk) || return undef; - } But it is more efficient as this loop runs internally in XS code. @@ -763,24 +765,24 @@ This is equivalent to the following method calls: - $p->handler(start => "start", "self, tagname, attr, attrseq, text"); - $p->handler(end => "end", "self, tagname, text"); - $p->handler(text => "text", "self, text, is_cdata"); - $p->handler(process => "process", "self, token0, text"); - $p->handler( - comment => sub { - my($self, $tokens) = @_; - for (@$tokens) {$self->comment($_);} - }, - "self, tokens" - ); - $p->handler( - declaration => sub { - my $self = shift; - $self->declaration(substr($_[0], 2, -1)); - }, - "self, text" - ); + $p->handler(start => "start", "self, tagname, attr, attrseq, text"); + $p->handler(end => "end", "self, tagname, text"); + $p->handler(text => "text", "self, text, is_cdata"); + $p->handler(process => "process", "self, token0, text"); + $p->handler( + comment => sub { + my ($self, $tokens) = @_; + for (@$tokens) { $self->comment($_); } + }, + "self, tokens" + ); + $p->handler( + declaration => sub { + my $self = shift; + $self->declaration(substr($_[0], 2, -1)); + }, + "self, text" + ); Setting up these handlers can also be requested with the "api_version => 2" constructor option. @@ -796,19 +798,21 @@ HTML document. We achieve this by setting up a comment handler that does nothing and a default handler that will print out anything else: - use HTML::Parser; - HTML::Parser->new( - default_h => [sub { print shift }, 'text'], - comment_h => [""], - )->parse_file(shift || die) || die $!; + use HTML::Parser (); + HTML::Parser->new( + default_h => [sub { print shift }, 'text'], + comment_h => [""], + )->parse_file(shift || die) + || die $!; An alternative implementation is: - use HTML::Parser; - HTML::Parser->new( - end_document_h => [sub { print shift }, 'skipped_text'], - comment_h => [""], - )->parse_file(shift || die) || die $!; + use HTML::Parser (); + HTML::Parser->new( + end_document_h => [sub { print shift }, 'skipped_text'], + comment_h => [""], + )->parse_file(shift || die) + || die $!; This will in most cases be much more efficient since only a single callback will be made. @@ -819,24 +823,24 @@ text found and an end handler that will terminate parsing as soon as the title end tag is seen: - use HTML::Parser (); - - sub start_handler { - return if shift ne "title"; - my $self = shift; - $self->handler(text => sub { print shift }, "dtext"); - $self->handler( - end => sub { - shift->eof if shift eq "title"; - }, - "tagname,self" - ); - } + use HTML::Parser (); - my $p = HTML::Parser->new(api_version => 3); - $p->handler(start => \&start_handler, "tagname,self"); - $p->parse_file(shift || die) || die $!; - print "\n"; + sub start_handler { + return if shift ne "title"; + my $self = shift; + $self->handler(text => sub { print shift }, "dtext"); + $self->handler( + end => sub { + shift->eof if shift eq "title"; + }, + "tagname,self" + ); + } + + my $p = HTML::Parser->new(api_version => 3); + $p->handler(start => \&start_handler, "tagname,self"); + $p->parse_file(shift || die) || die $!; + print "\n"; More examples are found in the eg/ directory of the "HTML-Parser" distribution: the program "hrefsub" shows how you can edit all links diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Parser-3.76/lib/HTML/Entities.pm new/HTML-Parser-3.77/lib/HTML/Entities.pm --- old/HTML-Parser-3.76/lib/HTML/Entities.pm 2021-03-04 19:05:46.000000000 +0100 +++ new/HTML-Parser-3.77/lib/HTML/Entities.pm 2022-03-14 23:11:58.000000000 +0100 @@ -136,7 +136,7 @@ =cut use strict; -our $VERSION = '3.76'; +our $VERSION = '3.77'; our (%entity2char, %char2entity); require 5.004; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Parser-3.76/lib/HTML/Filter.pm new/HTML-Parser-3.77/lib/HTML/Filter.pm --- old/HTML-Parser-3.76/lib/HTML/Filter.pm 2021-03-04 19:05:46.000000000 +0100 +++ new/HTML-Parser-3.77/lib/HTML/Filter.pm 2022-03-14 23:11:58.000000000 +0100 @@ -4,7 +4,7 @@ require HTML::Parser; our @ISA = qw(HTML::Parser); -our $VERSION = '3.76'; +our $VERSION = '3.77'; sub declaration { $_[0]->output("<!$_[1]>") } sub process { $_[0]->output($_[2]) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Parser-3.76/lib/HTML/HeadParser.pm new/HTML-Parser-3.77/lib/HTML/HeadParser.pm --- old/HTML-Parser-3.76/lib/HTML/HeadParser.pm 2021-03-04 19:05:46.000000000 +0100 +++ new/HTML-Parser-3.77/lib/HTML/HeadParser.pm 2022-03-14 23:11:58.000000000 +0100 @@ -91,7 +91,7 @@ use strict; our $DEBUG; #$DEBUG = 1; -our $VERSION = '3.76'; +our $VERSION = '3.77'; =item $hp = HTML::HeadParser->new diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Parser-3.76/lib/HTML/LinkExtor.pm new/HTML-Parser-3.77/lib/HTML/LinkExtor.pm --- old/HTML-Parser-3.76/lib/HTML/LinkExtor.pm 2021-03-04 19:05:46.000000000 +0100 +++ new/HTML-Parser-3.77/lib/HTML/LinkExtor.pm 2022-03-14 23:11:58.000000000 +0100 @@ -2,7 +2,7 @@ require HTML::Parser; our @ISA = qw(HTML::Parser); -our $VERSION = '3.76'; +our $VERSION = '3.77'; =head1 NAME diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Parser-3.76/lib/HTML/Parser.pm new/HTML-Parser-3.77/lib/HTML/Parser.pm --- old/HTML-Parser-3.76/lib/HTML/Parser.pm 2021-03-04 19:05:46.000000000 +0100 +++ new/HTML-Parser-3.77/lib/HTML/Parser.pm 2022-03-14 23:11:58.000000000 +0100 @@ -2,7 +2,7 @@ use strict; -our $VERSION = '3.76'; +our $VERSION = '3.77'; require HTML::Entities; @@ -129,30 +129,32 @@ =head1 SYNOPSIS - use strict; - use warnings; - use HTML::Parser (); - - # Create parser object - my $p = HTML::Parser->new( - api_version => 3, - start_h => [\&start, "tagname, attr"], - end_h => [\&end, "tagname"], - marked_sections => 1, - ); - - # Parse document text chunk by chunk - $p->parse($chunk1); - $p->parse($chunk2); - # ... - # signal end of document - $p->eof; - - # Parse directly from file - $p->parse_file("foo.html"); - # or - open(my $fh, "<:utf8", "foo.html") || die; - $p->parse_file($fh); + use strict; + use warnings; + use HTML::Parser (); + + # Create parser object + my $p = HTML::Parser->new( + api_version => 3, + start_h => [\&start, "tagname, attr"], + end_h => [\&end, "tagname"], + marked_sections => 1, + ); + + # Parse document text chunk by chunk + $p->parse($chunk1); + $p->parse($chunk2); + + # ... + # signal end of document + $p->eof; + + # Parse directly from file + $p->parse_file("foo.html"); + + # or + open(my $fh, "<:utf8", "foo.html") || die; + $p->parse_file($fh); =head1 DESCRIPTION @@ -262,14 +264,14 @@ The effect of this is the same as: - while (1) { - my $chunk = &$code_ref(); - if (!defined($chunk) || !length($chunk)) { - $p->eof; - return $p; + while (1) { + my $chunk = &$code_ref(); + if (!defined($chunk) || !length($chunk)) { + $p->eof; + return $p; + } + $p->parse($chunk) || return undef; } - $p->parse($chunk) || return undef; - } But it is more efficient as this loop runs internally in XS code. @@ -988,24 +990,24 @@ This is equivalent to the following method calls: - $p->handler(start => "start", "self, tagname, attr, attrseq, text"); - $p->handler(end => "end", "self, tagname, text"); - $p->handler(text => "text", "self, text, is_cdata"); - $p->handler(process => "process", "self, token0, text"); - $p->handler( - comment => sub { - my($self, $tokens) = @_; - for (@$tokens) {$self->comment($_);} - }, - "self, tokens" - ); - $p->handler( - declaration => sub { - my $self = shift; - $self->declaration(substr($_[0], 2, -1)); - }, - "self, text" - ); + $p->handler(start => "start", "self, tagname, attr, attrseq, text"); + $p->handler(end => "end", "self, tagname, text"); + $p->handler(text => "text", "self, text, is_cdata"); + $p->handler(process => "process", "self, token0, text"); + $p->handler( + comment => sub { + my ($self, $tokens) = @_; + for (@$tokens) { $self->comment($_); } + }, + "self, tokens" + ); + $p->handler( + declaration => sub { + my $self = shift; + $self->declaration(substr($_[0], 2, -1)); + }, + "self, text" + ); Setting up these handlers can also be requested with the "api_version => 2" constructor option. @@ -1023,19 +1025,21 @@ an HTML document. We achieve this by setting up a comment handler that does nothing and a default handler that will print out anything else: - use HTML::Parser; - HTML::Parser->new( - default_h => [sub { print shift }, 'text'], - comment_h => [""], - )->parse_file(shift || die) || die $!; + use HTML::Parser (); + HTML::Parser->new( + default_h => [sub { print shift }, 'text'], + comment_h => [""], + )->parse_file(shift || die) + || die $!; An alternative implementation is: - use HTML::Parser; - HTML::Parser->new( - end_document_h => [sub { print shift }, 'skipped_text'], - comment_h => [""], - )->parse_file(shift || die) || die $!; + use HTML::Parser (); + HTML::Parser->new( + end_document_h => [sub { print shift }, 'skipped_text'], + comment_h => [""], + )->parse_file(shift || die) + || die $!; This will in most cases be much more efficient since only a single callback will be made. @@ -1046,24 +1050,24 @@ that prints any text found and an end handler that will terminate parsing as soon as the title end tag is seen: - use HTML::Parser (); + use HTML::Parser (); - sub start_handler { - return if shift ne "title"; - my $self = shift; - $self->handler(text => sub { print shift }, "dtext"); - $self->handler( - end => sub { - shift->eof if shift eq "title"; - }, - "tagname,self" - ); - } + sub start_handler { + return if shift ne "title"; + my $self = shift; + $self->handler(text => sub { print shift }, "dtext"); + $self->handler( + end => sub { + shift->eof if shift eq "title"; + }, + "tagname,self" + ); + } - my $p = HTML::Parser->new(api_version => 3); - $p->handler(start => \&start_handler, "tagname,self"); - $p->parse_file(shift || die) || die $!; - print "\n"; + my $p = HTML::Parser->new(api_version => 3); + $p->handler(start => \&start_handler, "tagname,self"); + $p->parse_file(shift || die) || die $!; + print "\n"; More examples are found in the F<eg/> directory of the C<HTML-Parser> distribution: the program C<hrefsub> shows how you can edit all links diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Parser-3.76/lib/HTML/PullParser.pm new/HTML-Parser-3.77/lib/HTML/PullParser.pm --- old/HTML-Parser-3.76/lib/HTML/PullParser.pm 2021-03-04 19:05:46.000000000 +0100 +++ new/HTML-Parser-3.77/lib/HTML/PullParser.pm 2022-03-14 23:11:58.000000000 +0100 @@ -4,7 +4,7 @@ require HTML::Parser; our @ISA = qw(HTML::Parser); -our $VERSION = '3.76'; +our $VERSION = '3.77'; use Carp (); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Parser-3.76/lib/HTML/TokeParser.pm new/HTML-Parser-3.77/lib/HTML/TokeParser.pm --- old/HTML-Parser-3.76/lib/HTML/TokeParser.pm 2021-03-04 19:05:46.000000000 +0100 +++ new/HTML-Parser-3.77/lib/HTML/TokeParser.pm 2022-03-14 23:11:58.000000000 +0100 @@ -4,7 +4,7 @@ require HTML::PullParser; our @ISA = qw(HTML::PullParser); -our $VERSION = '3.76'; +our $VERSION = '3.77'; use Carp (); use HTML::Entities qw(decode_entities); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Parser-3.76/t/linkextor-base.t new/HTML-Parser-3.77/t/linkextor-base.t --- old/HTML-Parser-3.76/t/linkextor-base.t 2021-03-04 19:05:46.000000000 +0100 +++ new/HTML-Parser-3.77/t/linkextor-base.t 2022-03-14 23:11:58.000000000 +0100 @@ -14,7 +14,9 @@ <head> <base href="http://www.sn.no/"> </head> -<body background="http://www.sn.no/sn.gif"> +<body> +<form action="/post_here"> +</form> This is <A HREF="link.html">link</a> and an <img SRC="img.jpg" lowsrc="img.gif" alt="Image">. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Parser-3.76/xt/author/pod-spell.t new/HTML-Parser-3.77/xt/author/pod-spell.t --- old/HTML-Parser-3.76/xt/author/pod-spell.t 2021-03-04 19:05:46.000000000 +0100 +++ new/HTML-Parser-3.77/xt/author/pod-spell.t 2022-03-14 23:11:58.000000000 +0100 @@ -37,6 +37,7 @@ Ivanov Jacques Jensen +Jess Jon LinkExtor MSIE @@ -51,6 +52,7 @@ PullParser Radici Rinaldo +Robinson Salvatore Salzenberg Skytt?? @@ -72,6 +74,7 @@ barbie bulk88 capoeirab +castaway chip demerphq dmn diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/HTML-Parser-3.76/xt/release/changes_has_content.t new/HTML-Parser-3.77/xt/release/changes_has_content.t --- old/HTML-Parser-3.76/xt/release/changes_has_content.t 2021-03-04 19:05:46.000000000 +0100 +++ new/HTML-Parser-3.77/xt/release/changes_has_content.t 2022-03-14 23:11:58.000000000 +0100 @@ -2,7 +2,7 @@ note 'Checking Changes'; my $changes_file = 'Changes'; -my $newver = '3.76'; +my $newver = '3.77'; my $trial_token = '-TRIAL'; my $encoding = 'UTF-8';