From 433cf6b48b10555baabcf34f887d934c810b586d Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Fri, 18 Dec 2009 17:05:45 -0500 Subject: [PATCH] Upgrade to Pod::Simple 3.13 from CPAN to fix a regression (in 3.08) that broke html output --- MANIFEST | 1 - Porting/Maintainers.pl | 2 +- cpan/Pod-Simple/ChangeLog | 29 ++++++- cpan/Pod-Simple/README | 2 +- cpan/Pod-Simple/lib/Pod/Simple.pm | 4 +- cpan/Pod-Simple/lib/Pod/Simple.pod | 2 +- cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm | 4 +- cpan/Pod-Simple/lib/Pod/Simple/Checker.pm | 4 +- cpan/Pod-Simple/lib/Pod/Simple/Debug.pm | 4 +- cpan/Pod-Simple/lib/Pod/Simple/DumpAsText.pm | 4 +- cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm | 4 +- cpan/Pod-Simple/lib/Pod/Simple/HTML.pm | 32 +++++++- cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm | 4 +- cpan/Pod-Simple/lib/Pod/Simple/LinkSection.pm | 6 +- cpan/Pod-Simple/lib/Pod/Simple/Methody.pm | 4 +- cpan/Pod-Simple/lib/Pod/Simple/Progress.pm | 2 +- cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm | 4 +- .../lib/Pod/Simple/PullParserEndToken.pm | 4 +- .../lib/Pod/Simple/PullParserStartToken.pm | 4 +- .../lib/Pod/Simple/PullParserTextToken.pm | 4 +- cpan/Pod-Simple/lib/Pod/Simple/PullParserToken.pm | 4 +- cpan/Pod-Simple/lib/Pod/Simple/RTF.pm | 4 +- cpan/Pod-Simple/lib/Pod/Simple/Search.pm | 4 +- cpan/Pod-Simple/lib/Pod/Simple/SimpleTree.pm | 4 +- cpan/Pod-Simple/lib/Pod/Simple/Subclassing.pod | 2 +- cpan/Pod-Simple/lib/Pod/Simple/Text.pm | 4 +- cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm | 4 +- cpan/Pod-Simple/lib/Pod/Simple/TiedOutFH.pm | 2 +- cpan/Pod-Simple/lib/Pod/Simple/Transcode.pm | 2 +- cpan/Pod-Simple/lib/Pod/Simple/TranscodeDumb.pm | 2 +- cpan/Pod-Simple/lib/Pod/Simple/TranscodeSmart.pm | 2 +- cpan/Pod-Simple/lib/Pod/Simple/XHTML.pm | 89 +++++++++++++++++++--- cpan/Pod-Simple/lib/Pod/Simple/XMLOutStream.pm | 4 +- cpan/Pod-Simple/t/fullstop.t | 58 -------------- cpan/Pod-Simple/t/html01.t | 13 +++- cpan/Pod-Simple/t/items02.t | 87 ++++++++++----------- cpan/Pod-Simple/t/xhtml01.t | 26 ++++++- 37 files changed, 263 insertions(+), 172 deletions(-) delete mode 100644 cpan/Pod-Simple/t/fullstop.t diff --git a/MANIFEST b/MANIFEST index af12780..b7d7a11 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1948,7 +1948,6 @@ cpan/Pod-Simple/t/fcodes_s.t Pod::Simple test file cpan/Pod-Simple/t/fcodes.t Pod::Simple test file cpan/Pod-Simple/t/fornot.t Pod::Simple test file cpan/Pod-Simple/t/for.t Pod::Simple test file -cpan/Pod-Simple/t/fullstop.t Pod::Simple test file cpan/Pod-Simple/t/heads.t Pod::Simple test file cpan/Pod-Simple/t/html01.t Pod::Simple test file cpan/Pod-Simple/t/html02.t Pod::Simple test file diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index 25ff41c..c4a1a79 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -1293,7 +1293,7 @@ use File::Glob qw(:case); 'Pod::Simple' => { 'MAINTAINER' => 'arandal', - 'DISTRIBUTION' => 'DWHEELER/Pod-Simple-3.11.tar.gz', + 'DISTRIBUTION' => 'DWHEELER/Pod-Simple-3.13.tar.gz', 'FILES' => q[cpan/Pod-Simple], # XXX these two files correspond to similar ones in blead under # pod/, but the blead ones have newer changes, and also seem to diff --git a/cpan/Pod-Simple/ChangeLog b/cpan/Pod-Simple/ChangeLog index b6f59e8..a93ec9e 100644 --- a/cpan/Pod-Simple/ChangeLog +++ b/cpan/Pod-Simple/ChangeLog @@ -1,6 +1,33 @@ # ChangeLog for Pod::Simple dist #--------------------------------------------------------------------------- +2009-12-17 David E. Wheeler + * Release 3.13 + + Removed deleted test file from MANIFEST. + +2009-12-17 David E. Wheeler + * Release 3.12 + + Removed "All rights reserved" from all files. + + Added acknowledgements to man.he.net and search.cpan.org for + permission to link man pages and Perl module links to their sites + in the output of Pod::Simple::HTML and Pod::Simple::XHTML. + + Add "html_h_level" option to Pod::Simple::XHTML and ::HTML to allow + a =head1 to become an

and so on. RJBS. + + Add batch_mode_page_object_init() method to Pod::Simple::XHTML. + This allows it to be used by Pod::Simple::HTMLBatch. + + Fixed a regression in Pod::Simple::XHTML where '=begin html' blocks + were incorrectly escaped rather than simply passed through unmolested. + RJBS. + + Removed the undocumented "fullstop_space_harden" attribute, which + apparently was only used by Pod::Text a very long time ago. + 2009-12-09 David E. Wheeler * Release 3.11 @@ -45,7 +72,7 @@ version number lowered. 2009-11-12 David E. Wheeler - * Release 3.11 + * Release 3.10 Converted test files that had DOS endings to have Unix endings (RT #50922 from Steve Hay). diff --git a/cpan/Pod-Simple/README b/cpan/Pod-Simple/README index 00f0c12..5098095 100644 --- a/cpan/Pod-Simple/README +++ b/cpan/Pod-Simple/README @@ -1,4 +1,4 @@ -=head1 Pod::Simple version 3.11 +=head1 Pod::Simple version 3.13 Pod::Simple is a Perl library for parsing text in the Pod ("plain old documentation") markup language that is typically used for writing diff --git a/cpan/Pod-Simple/lib/Pod/Simple.pm b/cpan/Pod-Simple/lib/Pod/Simple.pm index 554eb81..97b5911 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple.pm @@ -18,7 +18,7 @@ use vars qw( ); @ISA = ('Pod::Simple::BlackBox'); -$VERSION = '3.11'; +$VERSION = '3.13'; @Known_formatting_codes = qw(I B C L E F S X Z); %Known_formatting_codes = map(($_=>1), @Known_formatting_codes); @@ -80,8 +80,6 @@ __PACKAGE__->_accessorize( 'bare_output', # For some subclasses: whether to prepend # header-code and postpend footer-code - 'fullstop_space_harden', # Whether to turn ". " into ".[nbsp] "; - 'nix_X_codes', # whether to ignore X<...> codes 'merge_text', # whether to avoid breaking a single piece of # text up into several events diff --git a/cpan/Pod-Simple/lib/Pod/Simple.pod b/cpan/Pod-Simple/lib/Pod/Simple.pod index 294fdba..d3f168d 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple.pod +++ b/cpan/Pod-Simple/lib/Pod/Simple.pod @@ -245,7 +245,7 @@ Patches against Pod::Simple are welcome. Please send bug reports to =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002 Sean M. Burke. All rights reserved. +Copyright (c) 2002 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm b/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm index 37094ad..c227d4c 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm @@ -23,7 +23,7 @@ use integer; # vroom! use strict; use Carp (); use vars qw($VERSION ); -$VERSION = '3.11'; +$VERSION = '3.13'; #use constant DEBUG => 7; BEGIN { require Pod::Simple; @@ -1628,8 +1628,6 @@ sub _treelet_from_formatting_codes { my $treelet = ['~Top', {'start_line' => $start_line},]; unless ($preserve_space || $self->{'preserve_whitespace'}) { - $para =~ s/\. /\.\xA0 /g if $self->{'fullstop_space_harden'}; - $para =~ s/\s+/ /g; # collapse and trim all whitespace first. $para =~ s/ $//; $para =~ s/^ //; diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Checker.pm b/cpan/Pod-Simple/lib/Pod/Simple/Checker.pm index cfaa2a8..136e851 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/Checker.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/Checker.pm @@ -9,7 +9,7 @@ use Carp (); use Pod::Simple::Methody (); use Pod::Simple (); use vars qw( @ISA $VERSION ); -$VERSION = '3.11'; +$VERSION = '3.13'; @ISA = ('Pod::Simple::Methody'); BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG) ? \&Pod::Simple::DEBUG @@ -167,7 +167,7 @@ Patches against Pod::Simple are welcome. Please send bug reports to =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002 Sean M. Burke. All rights reserved. +Copyright (c) 2002 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Debug.pm b/cpan/Pod-Simple/lib/Pod/Simple/Debug.pm index b4e4a6c..c2332fa 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/Debug.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/Debug.pm @@ -3,7 +3,7 @@ require 5; package Pod::Simple::Debug; use strict; use vars qw($VERSION ); -$VERSION = '3.11'; +$VERSION = '3.13'; sub import { my($value,$variable); @@ -149,7 +149,7 @@ Patches against Pod::Simple are welcome. Please send bug reports to =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002 Sean M. Burke. All rights reserved. +Copyright (c) 2002 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/Pod-Simple/lib/Pod/Simple/DumpAsText.pm b/cpan/Pod-Simple/lib/Pod/Simple/DumpAsText.pm index fd38945..0f75646 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/DumpAsText.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/DumpAsText.pm @@ -1,7 +1,7 @@ require 5; package Pod::Simple::DumpAsText; -$VERSION = '3.11'; +$VERSION = '3.13'; use Pod::Simple (); BEGIN {@ISA = ('Pod::Simple')} @@ -126,7 +126,7 @@ Patches against Pod::Simple are welcome. Please send bug reports to =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002 Sean M. Burke. All rights reserved. +Copyright (c) 2002 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm b/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm index 792b688..9e4b77f 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm @@ -1,7 +1,7 @@ require 5; package Pod::Simple::DumpAsXML; -$VERSION = '3.11'; +$VERSION = '3.13'; use Pod::Simple (); BEGIN {@ISA = ('Pod::Simple')} @@ -141,7 +141,7 @@ Patches against Pod::Simple are welcome. Please send bug reports to =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002 Sean M. Burke. All rights reserved. +Copyright (c) 2002 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/Pod-Simple/lib/Pod/Simple/HTML.pm b/cpan/Pod-Simple/lib/Pod/Simple/HTML.pm index 681cc4d..663a5e4 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/HTML.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/HTML.pm @@ -10,7 +10,7 @@ use vars qw( $Doctype_decl $Content_decl ); @ISA = ('Pod::Simple::PullParser'); -$VERSION = '3.11'; +$VERSION = '3.13'; use UNIVERSAL (); BEGIN { @@ -70,6 +70,8 @@ __PACKAGE__->_accessorize( 'title_prefix', 'title_postfix', # What to put before and after the title in the head. # Should already be &-escaped + + 'html_h_level', 'html_header_before_title', 'html_header_after_title', @@ -208,9 +210,25 @@ sub new { $new->html_footer( qq[\n\n\n\n] ); $new->{'Tagmap'} = {%Tagmap}; + return $new; } +sub __adjust_html_h_levels { + my ($self) = @_; + my $Tagmap = $self->{'Tagmap'}; + + my $add = $self->html_h_level; + return unless defined $add; + return if ($self->{'Adjusted_html_h_levels'}||0) == $add; + + $add -= 1; + for (1 .. 4) { + $Tagmap->{"head$_"} =~ s/$_/$_ + $add/e; + $Tagmap->{"/head$_"} =~ s/$_/$_ + $add/e; + } +} + sub batch_mode_page_object_init { my($self, $batchconvobj, $module, $infile, $outfile, $depth) = @_; DEBUG and print "Initting $self\n for $module\n", @@ -433,6 +451,8 @@ sub _do_middle_main_loop { my $self = $_[0]; my $fh = $self->{'output_fh'}; my $tagmap = $self->{'Tagmap'}; + + $self->__adjust_html_h_levels; my($token, $type, $tagname, $linkto, $linktype); my @stack; @@ -922,7 +942,7 @@ Patches against Pod::Simple are welcome. Please send bug reports to =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002-2004 Sean M. Burke. All rights reserved. +Copyright (c) 2002-2004 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. @@ -931,6 +951,14 @@ This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. +=head1 ACKNOWLEDGEMENTS + +Thanks to L for permission to use its +L site for man page links. + +Thanks to L for permission to use the +site for Perl module links. + =head1 AUTHOR Pod::Simple was created by Sean M. Burke . diff --git a/cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm b/cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm index 773c8dc..736ff53 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm @@ -5,7 +5,7 @@ use strict; use vars qw( $VERSION $HTML_RENDER_CLASS $HTML_EXTENSION $CSS $JAVASCRIPT $SLEEPY $SEARCH_CLASS @ISA ); -$VERSION = '3.11'; +$VERSION = '3.13'; @ISA = (); # Yup, we're NOT a subclass of Pod::Simple::HTML! # TODO: nocontents stylesheets. Strike some of the color variations? @@ -1343,7 +1343,7 @@ Patches against Pod::Simple are welcome. Please send bug reports to =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002 Sean M. Burke. All rights reserved. +Copyright (c) 2002 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/Pod-Simple/lib/Pod/Simple/LinkSection.pm b/cpan/Pod-Simple/lib/Pod/Simple/LinkSection.pm index 9a8f902..c219ebd 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/LinkSection.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/LinkSection.pm @@ -3,12 +3,12 @@ require 5; package Pod::Simple::LinkSection; # Based somewhat dimly on Array::Autojoin use vars qw($VERSION ); -$VERSION = '3.11'; +$VERSION = '3.13'; use strict; use Pod::Simple::BlackBox; use vars qw($VERSION ); -$VERSION = '3.11'; +$VERSION = '3.13'; use overload( # So it'll stringify nice '""' => \&Pod::Simple::BlackBox::stringify_lol, @@ -145,7 +145,7 @@ Patches against Pod::Simple are welcome. Please send bug reports to =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2004 Sean M. Burke. All rights reserved. +Copyright (c) 2004 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Methody.pm b/cpan/Pod-Simple/lib/Pod/Simple/Methody.pm index 40e2352..15c63ef 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/Methody.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/Methody.pm @@ -4,7 +4,7 @@ package Pod::Simple::Methody; use strict; use Pod::Simple (); use vars qw(@ISA $VERSION); -$VERSION = '3.11'; +$VERSION = '3.13'; @ISA = ('Pod::Simple'); # Yes, we could use named variables, but I want this to be impose @@ -123,7 +123,7 @@ Patches against Pod::Simple are welcome. Please send bug reports to =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002 Sean M. Burke. All rights reserved. +Copyright (c) 2002 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Progress.pm b/cpan/Pod-Simple/lib/Pod/Simple/Progress.pm index 8b65f79..06b643f 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/Progress.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/Progress.pm @@ -1,7 +1,7 @@ require 5; package Pod::Simple::Progress; -$VERSION = '3.11'; +$VERSION = '3.13'; use strict; # Objects of this class are used for noting progress of an diff --git a/cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm b/cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm index f6ae766..eaef116 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm @@ -1,7 +1,7 @@ require 5; package Pod::Simple::PullParser; -$VERSION = '3.11'; +$VERSION = '3.13'; use Pod::Simple (); BEGIN {@ISA = ('Pod::Simple')} @@ -743,7 +743,7 @@ Patches against Pod::Simple are welcome. Please send bug reports to =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002 Sean M. Burke. All rights reserved. +Copyright (c) 2002 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/Pod-Simple/lib/Pod/Simple/PullParserEndToken.pm b/cpan/Pod-Simple/lib/Pod/Simple/PullParserEndToken.pm index f4e23a4..2c32bd8 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/PullParserEndToken.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/PullParserEndToken.pm @@ -5,7 +5,7 @@ use Pod::Simple::PullParserToken (); use strict; use vars qw(@ISA $VERSION); @ISA = ('Pod::Simple::PullParserToken'); -$VERSION = '3.11'; +$VERSION = '3.13'; sub new { # Class->new(tagname); my $class = shift; @@ -91,7 +91,7 @@ Patches against Pod::Simple are welcome. Please send bug reports to =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002 Sean M. Burke. All rights reserved. +Copyright (c) 2002 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/Pod-Simple/lib/Pod/Simple/PullParserStartToken.pm b/cpan/Pod-Simple/lib/Pod/Simple/PullParserStartToken.pm index 37b6821..3980264 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/PullParserStartToken.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/PullParserStartToken.pm @@ -5,7 +5,7 @@ use Pod::Simple::PullParserToken (); use strict; use vars qw(@ISA $VERSION); @ISA = ('Pod::Simple::PullParserToken'); -$VERSION = '3.11'; +$VERSION = '3.13'; sub new { # Class->new(tagname, optional_attrhash); my $class = shift; @@ -132,7 +132,7 @@ Patches against Pod::Simple are welcome. Please send bug reports to =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002 Sean M. Burke. All rights reserved. +Copyright (c) 2002 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/Pod-Simple/lib/Pod/Simple/PullParserTextToken.pm b/cpan/Pod-Simple/lib/Pod/Simple/PullParserTextToken.pm index ccd03df..f33fc6e 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/PullParserTextToken.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/PullParserTextToken.pm @@ -5,7 +5,7 @@ use Pod::Simple::PullParserToken (); use strict; use vars qw(@ISA $VERSION); @ISA = ('Pod::Simple::PullParserToken'); -$VERSION = '3.11'; +$VERSION = '3.13'; sub new { # Class->new(text); my $class = shift; @@ -99,7 +99,7 @@ Patches against Pod::Simple are welcome. Please send bug reports to =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002 Sean M. Burke. All rights reserved. +Copyright (c) 2002 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/Pod-Simple/lib/Pod/Simple/PullParserToken.pm b/cpan/Pod-Simple/lib/Pod/Simple/PullParserToken.pm index ff8ccc1..3a156b4 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/PullParserToken.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/PullParserToken.pm @@ -3,7 +3,7 @@ require 5; package Pod::Simple::PullParserToken; # Base class for tokens gotten from Pod::Simple::PullParser's $parser->get_token @ISA = (); -$VERSION = '3.11'; +$VERSION = '3.13'; use strict; sub new { # Class->new('type', stuff...); ## Overridden in derived classes anyway @@ -134,7 +134,7 @@ Patches against Pod::Simple are welcome. Please send bug reports to =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002 Sean M. Burke. All rights reserved. +Copyright (c) 2002 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/Pod-Simple/lib/Pod/Simple/RTF.pm b/cpan/Pod-Simple/lib/Pod/Simple/RTF.pm index 33daf15..b89eac0 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/RTF.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/RTF.pm @@ -8,7 +8,7 @@ package Pod::Simple::RTF; use strict; use vars qw($VERSION @ISA %Escape $WRAP %Tagmap); -$VERSION = '3.11'; +$VERSION = '3.13'; use Pod::Simple::PullParser (); BEGIN {@ISA = ('Pod::Simple::PullParser')} @@ -670,7 +670,7 @@ Patches against Pod::Simple are welcome. Please send bug reports to =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002 Sean M. Burke. All rights reserved. +Copyright (c) 2002 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Search.pm b/cpan/Pod-Simple/lib/Pod/Simple/Search.pm index 3796434..37cd2e8 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/Search.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/Search.pm @@ -4,7 +4,7 @@ package Pod::Simple::Search; use strict; use vars qw($VERSION $MAX_VERSION_WITHIN $SLEEPY); -$VERSION = '3.11'; ## Current version of this package +$VERSION = '3.13'; ## Current version of this package BEGIN { *DEBUG = sub () {0} unless defined &DEBUG; } # set DEBUG level use Carp (); @@ -1011,7 +1011,7 @@ Patches against Pod::Simple are welcome. Please send bug reports to =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002 Sean M. Burke. All rights reserved. +Copyright (c) 2002 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/Pod-Simple/lib/Pod/Simple/SimpleTree.pm b/cpan/Pod-Simple/lib/Pod/Simple/SimpleTree.pm index ca9c7fb..7f39680 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/SimpleTree.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/SimpleTree.pm @@ -6,7 +6,7 @@ use strict; use Carp (); use Pod::Simple (); use vars qw( $ATTR_PAD @ISA $VERSION $SORT_ATTRS); -$VERSION = '3.11'; +$VERSION = '3.13'; BEGIN { @ISA = ('Pod::Simple'); *DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG; @@ -151,7 +151,7 @@ Patches against Pod::Simple are welcome. Please send bug reports to =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002 Sean M. Burke. All rights reserved. +Copyright (c) 2002 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Subclassing.pod b/cpan/Pod-Simple/lib/Pod/Simple/Subclassing.pod index d15f308..f2011d5 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/Subclassing.pod +++ b/cpan/Pod-Simple/lib/Pod/Simple/Subclassing.pod @@ -908,7 +908,7 @@ Patches against Pod::Simple are welcome. Please send bug reports to =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002 Sean M. Burke. All rights reserved. +Copyright (c) 2002 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Text.pm b/cpan/Pod-Simple/lib/Pod/Simple/Text.pm index 1713f04..fe89806 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/Text.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/Text.pm @@ -6,7 +6,7 @@ use Carp (); use Pod::Simple::Methody (); use Pod::Simple (); use vars qw( @ISA $VERSION $FREAKYMODE); -$VERSION = '3.11'; +$VERSION = '3.13'; @ISA = ('Pod::Simple::Methody'); BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG) ? \&Pod::Simple::DEBUG @@ -156,7 +156,7 @@ Patches against Pod::Simple are welcome. Please send bug reports to =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002 Sean M. Burke. All rights reserved. +Copyright (c) 2002 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm b/cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm index d920d53..badce4d 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm @@ -6,7 +6,7 @@ use strict; use Carp (); use Pod::Simple (); use vars qw( @ISA $VERSION ); -$VERSION = '3.11'; +$VERSION = '3.13'; @ISA = ('Pod::Simple'); sub new { @@ -83,7 +83,7 @@ Patches against Pod::Simple are welcome. Please send bug reports to =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002 Sean M. Burke. All rights reserved. +Copyright (c) 2002 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/Pod-Simple/lib/Pod/Simple/TiedOutFH.pm b/cpan/Pod-Simple/lib/Pod/Simple/TiedOutFH.pm index 9003d43..2899c0d 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/TiedOutFH.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/TiedOutFH.pm @@ -4,7 +4,7 @@ package Pod::Simple::TiedOutFH; use Symbol ('gensym'); use Carp (); use vars qw($VERSION ); -$VERSION = '3.11'; +$VERSION = '3.13'; #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Transcode.pm b/cpan/Pod-Simple/lib/Pod/Simple/Transcode.pm index 28ab27f..80f9f1c 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/Transcode.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/Transcode.pm @@ -2,7 +2,7 @@ require 5; package Pod::Simple::Transcode; use vars qw($VERSION ); -$VERSION = '3.11'; +$VERSION = '3.13'; BEGIN { if(defined &DEBUG) {;} # Okay diff --git a/cpan/Pod-Simple/lib/Pod/Simple/TranscodeDumb.pm b/cpan/Pod-Simple/lib/Pod/Simple/TranscodeDumb.pm index bf2fd27..afdc0c4 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/TranscodeDumb.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/TranscodeDumb.pm @@ -5,7 +5,7 @@ require 5; package Pod::Simple::TranscodeDumb; use strict; use vars qw($VERSION %Supported); -$VERSION = '3.11'; +$VERSION = '3.13'; # This module basically pretends it knows how to transcode, except # only for null-transcodings! We use this when Encode isn't # available. diff --git a/cpan/Pod-Simple/lib/Pod/Simple/TranscodeSmart.pm b/cpan/Pod-Simple/lib/Pod/Simple/TranscodeSmart.pm index 20c7588..d6dc62c 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/TranscodeSmart.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/TranscodeSmart.pm @@ -9,7 +9,7 @@ use strict; use Pod::Simple; require Encode; use vars qw($VERSION ); -$VERSION = '3.11'; +$VERSION = '3.13'; sub is_dumb {0} sub is_smart {1} diff --git a/cpan/Pod-Simple/lib/Pod/Simple/XHTML.pm b/cpan/Pod-Simple/lib/Pod/Simple/XHTML.pm index c371db9..fd4c9d6 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/XHTML.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/XHTML.pm @@ -28,7 +28,7 @@ L, but it largely preserves the same interface. package Pod::Simple::XHTML; use strict; use vars qw( $VERSION @ISA $HAS_HTML_ENTITIES ); -$VERSION = '3.11'; +$VERSION = '3.13'; use Carp (); use Pod::Simple::Methody (); @ISA = ('Pod::Simple::Methody'); @@ -117,6 +117,12 @@ default value is just a content type header tag: Add additional meta tags here, or blocks of inline CSS or JavaScript (wrapped in the appropriate tags). +=head2 html_h_level + +This is the level of HTML "Hn" element to which a Pod "head1" corresponds. For +example, if C is set to 2, a head1 will produce an H2, a head2 +will produce an H3, and so on. + =head2 default_title Set a default title for the page if no title can be determined from the @@ -163,6 +169,7 @@ __PACKAGE__->_accessorize( 'html_javascript', 'html_doctype', 'html_header_tags', + 'html_h_level', 'title', # Used internally for the title extracted from the content 'default_title', 'force_title', @@ -189,7 +196,6 @@ sub new { my $self = shift; my $new = $self->SUPER::new(@_); $new->{'output_fh'} ||= *STDOUT{IO}; - $new->accept_targets( 'html', 'HTML' ); $new->perldoc_url_prefix('http://search.cpan.org/perldoc?'); $new->man_url_prefix('http://man.he.net/man'); $new->html_header_tags(''); @@ -200,6 +206,11 @@ sub new { $new->{'output'} = []; $new->{'saved'} = []; $new->{'ids'} = {}; + + $new->{'__region_targets'} = []; + $new->{'__literal_targets'} = {}; + $new->accept_targets_as_html( 'html', 'HTML' ); + return $new; } @@ -235,11 +246,31 @@ something like: } } +=head2 accept_targets_as_html + +This method behaves like C, but also marks the region +as one whose content should be emitted literally, without HTML entity escaping +or wrapping in a C
element. + =cut +sub __in_literal_xhtml_region { + return unless @{ $_[0]{__region_targets} }; + my $target = $_[0]{__region_targets}[-1]; + return $_[0]{__literal_targets}{ $target }; +} + +sub accept_targets_as_html { + my ($self, @targets) = @_; + $self->accept_targets(@targets); + $self->{__literal_targets}{$_} = 1 for @targets; +} + sub handle_text { # escape special characters in HTML (<, >, &, etc) - $_[0]{'scratch'} .= encode_entities( $_[1] ) + $_[0]{'scratch'} .= $_[0]->__in_literal_xhtml_region + ? $_[1] + : encode_entities( $_[1] ); } sub start_Para { $_[0]{'scratch'} = '

' } @@ -314,6 +345,11 @@ sub end_Verbatim { sub _end_head { my $h = delete $_[0]{in_head}; + + my $add = $_[0]->html_h_level; + $add = 1 unless defined $add; + $h += $add - 1; + my $id = $_[0]->idify($_[0]{scratch}); my $text = $_[0]{scratch}; $_[0]{'scratch'} = qq{$text}; @@ -338,15 +374,24 @@ sub end_item_text { # This handles =begin and =for blocks of all kinds. sub start_for { my ($self, $flags) = @_; - $self->{'scratch'} .= '{'scratch'} .= ' class="'.$flags->{'target'}.'"' if ($flags->{'target'}); - $self->{'scratch'} .= '>'; + + push @{ $self->{__region_targets} }, $flags->{target_matching}; + + unless ($self->__in_literal_xhtml_region) { + $self->{scratch} .= '{scratch} .= qq( class="$flags->{target}") if $flags->{target}; + $self->{scratch} .= '>'; + } + $self->emit; } sub end_for { my ($self) = @_; - $self->{'scratch'} .= '

'; + + $self->{'scratch'} .= '' unless $self->__in_literal_xhtml_region; + + pop @{ $self->{__region_targets} }; $self->emit; } @@ -592,13 +637,27 @@ sub idify { return "$t$i"; } -1; +=head2 batch_mode_page_object_init -__END__ + $pod->batch_mode_page_object_init($batchconvobj, $module, $infile, $outfile, $depth); -=head1 SEE ALSO +Called by L so that the class has a chance to +initialize the converter. Internally it sets the C property to +true and sets C, but Pod::Simple::XHTML does not +currently use those features. Subclasses might, though. + +=cut -L, L +sub batch_mode_page_object_init { + my ($self, $batchconvobj, $module, $infile, $outfile, $depth) = @_; + $self->batch_mode(1); + $self->batch_mode_current_level($depth); + return $self; +} + +1; + +__END__ =head1 SEE ALSO @@ -628,6 +687,14 @@ This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. +=head1 ACKNOWLEDGEMENTS + +Thanks to L for permission to use its +L site for man page links. + +Thanks to L for permission to use the +site for Perl module links. + =head1 AUTHOR Pod::Simpele::XHTML was created by Allison Randal . diff --git a/cpan/Pod-Simple/lib/Pod/Simple/XMLOutStream.pm b/cpan/Pod-Simple/lib/Pod/Simple/XMLOutStream.pm index e81f9a8..afe30ce 100644 --- a/cpan/Pod-Simple/lib/Pod/Simple/XMLOutStream.pm +++ b/cpan/Pod-Simple/lib/Pod/Simple/XMLOutStream.pm @@ -5,7 +5,7 @@ use strict; use Carp (); use Pod::Simple (); use vars qw( $ATTR_PAD @ISA $VERSION $SORT_ATTRS); -$VERSION = '3.11'; +$VERSION = '3.13'; BEGIN { @ISA = ('Pod::Simple'); *DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG; @@ -156,7 +156,7 @@ Patches against Pod::Simple are welcome. Please send bug reports to =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2002-2004 Sean M. Burke. All rights reserved. +Copyright (c) 2002-2004 Sean M. Burke. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/cpan/Pod-Simple/t/fullstop.t b/cpan/Pod-Simple/t/fullstop.t deleted file mode 100644 index f2e9110..0000000 --- a/cpan/Pod-Simple/t/fullstop.t +++ /dev/null @@ -1,58 +0,0 @@ -# Testing hardening fullstop spaces -BEGIN { - if($ENV{PERL_CORE}) { - chdir 't'; - @INC = '../lib'; - } -} - -use strict; -use Test; -BEGIN { plan tests => 11 }; - -#use Pod::Simple::Debug (6); - -print "# Hi, I'm ", __FILE__, "\n"; -ok 1; - -use Pod::Simple; -use Pod::Simple::DumpAsXML; -use Pod::Simple::XMLOutStream; -print "# Pod::Simple version $Pod::Simple::VERSION\n"; -sub e ($$) { Pod::Simple::DumpAsXML->_duo(@_) } - -&ok( e "", "" ); -&ok( e "\n", "", ); - -die unless ok !! Pod::Simple::XMLOutStream->can('fullstop_space_harden'); -sub harden { $_[0]->fullstop_space_harden(1) } - -print "# Test that \". \" always compacts without the hardening on...\n"; - -ok( Pod::Simple::XMLOutStream->_out("\n=pod\n\nShe set me a message about the M.D. I\ncalled back!\n"), - qq{She set me a message about the M.D. I called back!} -); -ok( Pod::Simple::XMLOutStream->_out("\n=pod\n\nShe set me a message about the M.D. I called back!\n"), - qq{She set me a message about the M.D. I called back!} -); -ok( Pod::Simple::XMLOutStream->_out("\n=pod\n\nShe set me a message about the M.D.\nI called back!\n"), - qq{She set me a message about the M.D. I called back!} -); - - -print "# Now testing with the hardening on...\n"; - -ok( Pod::Simple::XMLOutStream->_out(\&harden, "\n=pod\n\nShe set me a message about the M.D. I\ncalled back!\n"), - qq{She set me a message about the M.D.  I called back!} -); -ok( Pod::Simple::XMLOutStream->_out(\&harden, "\n=pod\n\nShe set me a message about the M.D. I called back!\n"), - qq{She set me a message about the M.D. I called back!} -); -ok( Pod::Simple::XMLOutStream->_out(\&harden, "\n=pod\n\nShe set me a message about the M.D.\nI called back!\n"), - qq{She set me a message about the M.D. I called back!} -); - - -print "# Byebye\n"; -ok 1; - diff --git a/cpan/Pod-Simple/t/html01.t b/cpan/Pod-Simple/t/html01.t index 86e84ee..9616370 100644 --- a/cpan/Pod-Simple/t/html01.t +++ b/cpan/Pod-Simple/t/html01.t @@ -9,14 +9,16 @@ BEGIN { use strict; use Test; -BEGIN { plan tests => 10 }; +BEGIN { plan tests => 11 }; #use Pod::Simple::Debug (10); use Pod::Simple::HTML; -sub x ($) { Pod::Simple::HTML->_out( - sub{ $_[0]->bare_output(1) }, +sub x ($;&) { + my $code = $_[1]; + Pod::Simple::HTML->_out( + sub{ $_[0]->bare_output(1); $code->($_[0]) if $code }, "=pod\n\n$_[0]", ) } @@ -52,6 +54,11 @@ ok(x( "heading building" ); +ok(x('=head1 This is a heading', sub { $_[0]->html_h_level(2) }) + => q{/\s*

]+>This\s+is\s+a\s+heading

\s*$/}, + "heading building" +); + ok(x( '=head2 This is a heading too') => q{/\s*

]+>This\s+is\s+a\s+heading\s+too

\s*$/}, diff --git a/cpan/Pod-Simple/t/items02.t b/cpan/Pod-Simple/t/items02.t index 3119682..d604baa 100644 --- a/cpan/Pod-Simple/t/items02.t +++ b/cpan/Pod-Simple/t/items02.t @@ -1,43 +1,44 @@ -# Testing the =item directive -BEGIN { - if($ENV{PERL_CORE}) { - chdir 't'; - @INC = '../lib'; - } -} - -use strict; -use Test; -BEGIN { plan tests => 4 }; - -my $d; -#use Pod::Simple::Debug (\$d,0); - -ok 1; - -use Pod::Simple::DumpAsXML; -use Pod::Simple::XMLOutStream; -print "# Pod::Simple version $Pod::Simple::VERSION\n"; -sub e ($$) { Pod::Simple::DumpAsXML->_duo(@_) } - -my $x = 'Pod::Simple::XMLOutStream'; - -print "##### Tests for =item directives via class $x\n"; - -$Pod::Simple::XMLOutStream::ATTR_PAD = ' '; -$Pod::Simple::XMLOutStream::SORT_ATTRS = 1; # for predictably testable output - - -print "#\n# Tests for =item [number] that are icky...\n"; -ok( $x->_out("\n=over\n\n=item 5\n\nStuff\n\n=cut\n\nCrunk\nZorp\n\n=item 4\n\nQuux\n\n=back\n\n"), - '5Stuff4Quux' -); - -ok( $x->_out("\n=over\n\n=item 5.\n\nStuff\n\n=cut\n\nCrunk\nZorp\n\n=item 4.\n\nQuux\n\n=back\n\n"), - '5.Stuff4.Quux' -); - - -print "# Wrapping up... one for the road...\n"; -ok 1; -print "# --- Done with ", __FILE__, " --- \n"; +# Testing the =item directive +BEGIN { + if($ENV{PERL_CORE}) { + chdir 't'; + @INC = '../lib'; + } +} + +use strict; +use Test; +BEGIN { plan tests => 4 }; + +my $d; +#use Pod::Simple::Debug (\$d,0); + +ok 1; + +use Pod::Simple::DumpAsXML; +use Pod::Simple::XMLOutStream; +print "# Pod::Simple version $Pod::Simple::VERSION\n"; +sub e ($$) { Pod::Simple::DumpAsXML->_duo(@_) } + +my $x = 'Pod::Simple::XMLOutStream'; + +print "##### Tests for =item directives via class $x\n"; + +$Pod::Simple::XMLOutStream::ATTR_PAD = ' '; +$Pod::Simple::XMLOutStream::SORT_ATTRS = 1; # for predictably testable output + + +print "#\n# Tests for =item [number] that are icky...\n"; +ok( $x->_out("\n=over\n\n=item 5\n\nStuff\n\n=cut\n\nCrunk\nZorp\n\n=item 4\n\nQuux\n\n=back\n\n"), + '5Stuff4Quux' +); + +ok( $x->_out("\n=over\n\n=item 5.\n\nStuff\n\n=cut\n\nCrunk\nZorp\n\n=item 4.\n\nQuux\n\n=back\n\n"), + '5.Stuff4.Quux' +); + + +print "# Wrapping up... one for the road...\n"; +ok 1; +print "# --- Done with ", __FILE__, " --- \n"; + diff --git a/cpan/Pod-Simple/t/xhtml01.t b/cpan/Pod-Simple/t/xhtml01.t index e0993a5..e51df80 100644 --- a/cpan/Pod-Simple/t/xhtml01.t +++ b/cpan/Pod-Simple/t/xhtml01.t @@ -8,7 +8,7 @@ BEGIN { use strict; use lib '../lib'; -use Test::More tests => 43; +use Test::More tests => 48; #use Test::More 'no_plan'; use_ok('Pod::Simple::XHTML') or exit; @@ -26,6 +26,11 @@ $parser->parse_string_document( "=head1 Poit!" ); is($results, qq{

Poit!

\n\n}, "head1 level output"); initialize($parser, $results); +$parser->html_h_level(2); +$parser->parse_string_document( "=head1 Poit!" ); +is($results, qq{

Poit!

\n\n}, "head1 level output h_level 2"); + +initialize($parser, $results); $parser->parse_string_document( "=head2 I think so Brain." ); is($results, qq{

I think so Brain.

\n\n}, "head2 level output"); @@ -37,6 +42,18 @@ initialize($parser, $results); $parser->parse_string_document( "=head4 Zort & Zog!" ); is($results, qq{

Zort & Zog!

\n\n}, "head4 level output"); +sub x ($;&) { + my $code = $_[1]; + Pod::Simple::XHTML->_out( + sub { $code->($_[0]) if $code }, + "=pod\n\n$_[0]", +) } + +like( + x("=head1 Header\n\n=for html
RAW!
\n\nDone."), + qr/.+<\/h1>\s+
RAW!<\/span><\/div>\s+.*/sm, + "heading building" +) or exit; initialize($parser, $results); $parser->parse_string_document(<<'EOPOD'); @@ -563,6 +580,13 @@ is $parser->resolve_man_page_link('crontab(5)'), is $parser->resolve_man_page_link('crontab'), "${MANURL}1/crontab", 'Man link without section'; +# Make sure that batch_mode_page_object_init() works. +ok $parser->batch_mode_page_object_init(0, 0, 0, 0, 6), + 'Call batch_mode_page_object_init()'; +ok $parser->batch_mode, 'We should be in batch mode'; +is $parser->batch_mode_current_level, 6, + 'The level should have been set'; + ###################################### sub initialize { -- 2.7.4