diff options
author | 2014-03-24 14:58:42 +0000 | |
---|---|---|
committer | 2014-03-24 14:58:42 +0000 | |
commit | 91f110e064cd7c194e59e019b83bb7496c1c84d4 (patch) | |
tree | 3e8e577405dba7e94b43cbf21c22f21aaa5ab949 /gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple | |
parent | do not call purge_task every 10 secs, it is only needed once at startup and (diff) | |
download | wireguard-openbsd-91f110e064cd7c194e59e019b83bb7496c1c84d4.tar.xz wireguard-openbsd-91f110e064cd7c194e59e019b83bb7496c1c84d4.zip |
Import perl-5.18.2
OK espie@ sthen@ deraadt@
Diffstat (limited to 'gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple')
26 files changed, 332 insertions, 220 deletions
diff --git a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm index c17cfd0ad51..a1b570810d0 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm +++ b/gnu/usr.bin/perl/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.20'; +$VERSION = '3.28'; #use constant DEBUG => 7; BEGIN { require Pod::Simple; @@ -91,6 +91,7 @@ sub parse_lines { # Usage: $parser->parse_lines(@lines) if( ($line = $source_line) =~ s/^\xEF\xBB\xBF//s ) { DEBUG and print "UTF-8 BOM seen. Faking a '=encoding utf8'.\n"; $self->_handle_encoding_line( "=encoding utf8" ); + delete $self->{'_processed_encoding'}; $line =~ tr/\n\r//d; } elsif( $line =~ s/^\xFE\xFF//s ) { @@ -123,6 +124,22 @@ sub parse_lines { # Usage: $parser->parse_lines(@lines) } } + # Try to guess encoding. Inlined for performance reasons. + if(!$self->{'parse_characters'} && !$self->{'encoding'} + && ($self->{'in_pod'} || $line =~ /^=/s) + && $line =~ /[^\x00-\x7f]/ + ) { + my $encoding = $line =~ /^[\x00-\x7f]*[\xC0-\xFD][\x80-\xBF]/ ? 'UTF-8' : 'ISO8859-1'; + $self->_handle_encoding_line( "=encoding $encoding" ); + $self->{'_transcoder'} && $self->{'_transcoder'}->($line); + + my ($word) = $line =~ /(\S*[^\x00-\x7f]\S*)/; + + $self->whine( + $self->{'line_count'}, + "Non-ASCII character seen before =encoding in '$word'. Assuming $encoding" + ); + } DEBUG > 5 and print "# Parsing line: [$line]\n"; @@ -176,6 +193,7 @@ sub parse_lines { # Usage: $parser->parse_lines(@lines) # HERE WE CATCH =encoding EARLY! if( $line =~ m/^=encoding\s+\S+\s*$/s ) { + next if $self->parse_characters; # Ignore this line $line = $self->_handle_encoding_line( $line ); } @@ -269,6 +287,8 @@ sub parse_lines { # Usage: $parser->parse_lines(@lines) sub _handle_encoding_line { my($self, $line) = @_; + return if $self->parse_characters; + # The point of this routine is to set $self->{'_transcoder'} as indicated. return $line unless $line =~ m/^=encoding\s+(\S+)\s*$/s; @@ -324,6 +344,7 @@ sub _handle_encoding_line { $@ && die( $enc_error = "Really unexpected error setting up encoding $e: $@\nAborting" ); + $self->{'detected_encoding'} = $e; } else { my @supported = Pod::Simple::Transcode::->all_encodings; @@ -354,8 +375,13 @@ sub _handle_encoding_line { $self->scream( $self->{'line_count'}, $enc_error ); } push @{ $self->{'encoding_command_statuses'} }, $enc_error; + if (defined($self->{'_processed_encoding'})) { + # Should never happen + die "Nested processed encoding."; + } + $self->{'_processed_encoding'} = $orig; - return '=encoding ALREADYDONE'; + return $line; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -371,7 +397,11 @@ sub _handle_encoding_second_level { DEBUG > 2 and print "Ogling encoding directive: =encoding $content\n"; - if($content eq 'ALREADYDONE') { + if (defined($self->{'_processed_encoding'})) { + #if($content ne $self->{'_processed_encoding'}) { + # Could it happen? + #} + delete $self->{'_processed_encoding'}; # It's already been handled. Check for errors. if(! $self->{'encoding_command_statuses'} ) { DEBUG > 2 and print " CRAZY ERROR: It wasn't really handled?!\n"; @@ -642,8 +672,10 @@ sub _ponder_paragraph_buffer { if($item_type eq 'text') { # Nothing special needs doing for 'text' } elsif($item_type eq 'number' or $item_type eq 'bullet') { - die "Unknown item type $item_type" - unless $item_type eq 'number' or $item_type eq 'bullet'; + $self->whine( + $para->[1]{'start_line'}, + "Expected text after =item, not a $item_type" + ); # Undo our clobbering: push @$para, $para->[1]{'~orig_content'}; delete $para->[1]{'number'}; @@ -772,8 +804,8 @@ sub _ponder_paragraph_buffer { } elsif($para_type eq '=encoding') { # Not actually acted on here, but we catch errors here. $self->_handle_encoding_second_level($para); - - next; # and skip + next unless $self->keep_encoding_directive; + $para_type = 'Plain'; } elsif($para_type eq '~Verbatim') { $para->[0] = 'Verbatim'; $para_type = '?Verbatim'; @@ -1250,8 +1282,10 @@ sub _ponder_item { if($item_type eq 'text') { # Nothing special needs doing for 'text' } elsif($item_type eq 'number' or $item_type eq 'bullet') { - die "Unknown item type $item_type" - unless $item_type eq 'number' or $item_type eq 'bullet'; + $self->whine( + $para->[1]{'start_line'}, + "Expected text after =item, not a $item_type" + ); # Undo our clobbering: push @$para, $para->[1]{'~orig_content'}; delete $para->[1]{'number'}; @@ -1459,10 +1493,12 @@ sub _traverse_treelet_bit { # for use only by the routine above my $scratch; $self->_handle_element_start(($scratch=$name), shift @_); - foreach my $x (@_) { - if(ref($x)) { + while (@_) { + my $x = shift; + if (ref($x)) { &_traverse_treelet_bit($self, @$x); } else { + $x .= shift while @_ && !ref($_[0]); $self->_handle_text($x); } } @@ -1483,6 +1519,11 @@ sub _closers_for_all_curr_open { if($copy[0] eq '=for') { $copy[0] = '=end'; } elsif($copy[0] eq '=over') { + $self->whine( + $still_open->[1]{start_line} , + "=over without closing =back" + ); + $copy[0] = '=back'; } else { die "I don't know how to auto-close an open $copy[0] region"; diff --git a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/Checker.pm b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/Checker.pm index c97267a86ba..92e1bee238a 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/Checker.pm +++ b/gnu/usr.bin/perl/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.20'; +$VERSION = '3.28'; @ISA = ('Pod::Simple::Methody'); BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG) ? \&Pod::Simple::DEBUG @@ -159,7 +159,7 @@ pod-people@perl.org mail list. Send an empty email to pod-people-subscribe@perl.org to subscribe. This module is managed in an open GitHub repository, -L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or +L<https://github.com/theory/pod-simple/>. Feel free to fork and contribute, or to clone L<git://github.com/theory/pod-simple.git> and send patches! Patches against Pod::Simple are welcome. Please send bug reports to diff --git a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/Debug.pm b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/Debug.pm index 57733028427..b170bb780ab 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/Debug.pm +++ b/gnu/usr.bin/perl/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.20'; +$VERSION = '3.28'; sub import { my($value,$variable); @@ -141,7 +141,7 @@ pod-people@perl.org mail list. Send an empty email to pod-people-subscribe@perl.org to subscribe. This module is managed in an open GitHub repository, -L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or +L<https://github.com/theory/pod-simple/>. Feel free to fork and contribute, or to clone L<git://github.com/theory/pod-simple.git> and send patches! Patches against Pod::Simple are welcome. Please send bug reports to diff --git a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/DumpAsText.pm b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/DumpAsText.pm index 5e2d7ebf5ff..019dfd57fbd 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/DumpAsText.pm +++ b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/DumpAsText.pm @@ -1,7 +1,7 @@ require 5; package Pod::Simple::DumpAsText; -$VERSION = '3.20'; +$VERSION = '3.28'; use Pod::Simple (); BEGIN {@ISA = ('Pod::Simple')} @@ -16,6 +16,7 @@ sub new { my $new = $self->SUPER::new(@_); $new->{'output_fh'} ||= *STDOUT{IO}; $new->accept_codes('VerbatimFormatted'); + $new->keep_encoding_directive(1); return $new; } @@ -118,7 +119,7 @@ pod-people@perl.org mail list. Send an empty email to pod-people-subscribe@perl.org to subscribe. This module is managed in an open GitHub repository, -L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or +L<https://github.com/theory/pod-simple/>. Feel free to fork and contribute, or to clone L<git://github.com/theory/pod-simple.git> and send patches! Patches against Pod::Simple are welcome. Please send bug reports to diff --git a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm index e43422bbd7c..ac925c08eff 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm +++ b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm @@ -1,13 +1,14 @@ require 5; package Pod::Simple::DumpAsXML; -$VERSION = '3.20'; +$VERSION = '3.28'; use Pod::Simple (); BEGIN {@ISA = ('Pod::Simple')} use strict; use Carp (); +use Text::Wrap qw(wrap); BEGIN { *DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG } @@ -16,6 +17,7 @@ sub new { my $new = $self->SUPER::new(@_); $new->{'output_fh'} ||= *STDOUT{IO}; $new->accept_codes('VerbatimFormatted'); + $new->keep_encoding_directive(1); return $new; } @@ -49,15 +51,8 @@ sub _handle_text { my $indent = ' ' x $_[0]{'indent'}; my $text = $_[1]; _xml_escape($text); - $text =~ # A not-totally-brilliant wrapping algorithm: - s/( - [^\n]{55} # Snare some characters from a line - [^\n\ ]{0,50} # and finish any current word - ) - \x20{1,10}(?!\n) # capture some spaces not at line-end - /$1\n$indent/gx # => line-break here - ; - + local $Text::Wrap::huge = 'overflow'; + $text = wrap('', $indent, $text); print {$_[0]{'output_fh'}} $indent, $text, "\n"; } return; @@ -133,7 +128,7 @@ pod-people@perl.org mail list. Send an empty email to pod-people-subscribe@perl.org to subscribe. This module is managed in an open GitHub repository, -L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or +L<https://github.com/theory/pod-simple/>. Feel free to fork and contribute, or to clone L<git://github.com/theory/pod-simple.git> and send patches! Patches against Pod::Simple are welcome. Please send bug reports to diff --git a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/HTML.pm b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/HTML.pm index 12fad403589..8a2f81569c1 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/HTML.pm +++ b/gnu/usr.bin/perl/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.20'; +$VERSION = '3.28'; BEGIN { if(defined &DEBUG) { } # no-op @@ -134,7 +134,7 @@ my @_to_accept; qw[ sample=samp definition=dfn - kbd=keyboard + keyboard=kbd variable=var citation=cite abbreviation=abbr @@ -145,6 +145,8 @@ my @_to_accept; small=small underline=u strikethrough=s + preformat=pre + teletype=tt ] # no point in providing a way to get <q>...</q>, I think ), @@ -1089,7 +1091,7 @@ pod-people@perl.org mail list. Send an empty email to pod-people-subscribe@perl.org to subscribe. This module is managed in an open GitHub repository, -L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or +L<https://github.com/theory/pod-simple/>. Feel free to fork and contribute, or to clone L<git://github.com/theory/pod-simple.git> and send patches! Patches against Pod::Simple are welcome. Please send bug reports to diff --git a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm index 52e77bcc1b8..e41b11e2c50 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm +++ b/gnu/usr.bin/perl/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.20'; +$VERSION = '3.28'; @ISA = (); # Yup, we're NOT a subclass of Pod::Simple::HTML! # TODO: nocontents stylesheets. Strike some of the color variations? @@ -1093,7 +1093,7 @@ Example: % mkdir ../seekrut % chmod og-rx ../seekrut - % perl -MPod::Simple::HTMLBatch -e Pod::Simple::HTMLBatch::go . ../htmlversion + % perl -MPod::Simple::HTMLBatch -e Pod::Simple::HTMLBatch::go . ../seekrut (to convert the pod under the current dir into HTML files under the directory ./seekrut) @@ -1333,7 +1333,7 @@ pod-people@perl.org mail list. Send an empty email to pod-people-subscribe@perl.org to subscribe. This module is managed in an open GitHub repository, -L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or +L<https://github.com/theory/pod-simple/>. Feel free to fork and contribute, or to clone L<git://github.com/theory/pod-simple.git> and send patches! Patches against Pod::Simple are welcome. Please send bug reports to diff --git a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/LinkSection.pm b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/LinkSection.pm index 5aa5bc19897..be1f5345d08 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/LinkSection.pm +++ b/gnu/usr.bin/perl/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.20'; +$VERSION = '3.28'; use strict; use Pod::Simple::BlackBox; use vars qw($VERSION ); -$VERSION = '3.20'; +$VERSION = '3.28'; use overload( # So it'll stringify nice '""' => \&Pod::Simple::BlackBox::stringify_lol, @@ -137,7 +137,7 @@ pod-people@perl.org mail list. Send an empty email to pod-people-subscribe@perl.org to subscribe. This module is managed in an open GitHub repository, -L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or +L<https://github.com/theory/pod-simple/>. Feel free to fork and contribute, or to clone L<git://github.com/theory/pod-simple.git> and send patches! Patches against Pod::Simple are welcome. Please send bug reports to diff --git a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/Methody.pm b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/Methody.pm index 4113daf2351..38acaa20d0b 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/Methody.pm +++ b/gnu/usr.bin/perl/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.20'; +$VERSION = '3.28'; @ISA = ('Pod::Simple'); # Yes, we could use named variables, but I want this to be impose @@ -115,7 +115,7 @@ pod-people@perl.org mail list. Send an empty email to pod-people-subscribe@perl.org to subscribe. This module is managed in an open GitHub repository, -L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or +L<https://github.com/theory/pod-simple/>. Feel free to fork and contribute, or to clone L<git://github.com/theory/pod-simple.git> and send patches! Patches against Pod::Simple are welcome. Please send bug reports to diff --git a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/Progress.pm b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/Progress.pm index e85084a1c26..f9cd6816722 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/Progress.pm +++ b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/Progress.pm @@ -1,7 +1,7 @@ require 5; package Pod::Simple::Progress; -$VERSION = '3.20'; +$VERSION = '3.28'; use strict; # Objects of this class are used for noting progress of an diff --git a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm index c9726fd564a..5c13724dc11 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm +++ b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm @@ -1,7 +1,7 @@ require 5; package Pod::Simple::PullParser; -$VERSION = '3.20'; +$VERSION = '3.28'; use Pod::Simple (); BEGIN {@ISA = ('Pod::Simple')} @@ -347,6 +347,7 @@ sub _get_titled_section { my $head1_text_content; my $para_text_content; + my $skipX; while( ++$token_count <= ($max_token || 1_000_000) @@ -364,8 +365,14 @@ sub _get_titled_section { elsif($state == 1) { # accumulating text until end of head1 if( $token->is_text ) { - DEBUG and print " Adding \"", $token->text, "\" to head1-content.\n"; - $head1_text_content .= $token->text; + unless ($skipX) { + DEBUG and print " Adding \"", $token->text, "\" to head1-content.\n"; + $head1_text_content .= $token->text; + } + } elsif( $token->is_tagname('X') ) { + # We're going to want to ignore X<> stuff. + $skipX = $token->is_start; + DEBUG and print +($skipX ? 'Start' : 'End'), 'ing ignoring of X<> tag'; } elsif( $token->is_end and $token->tagname eq 'head1' ) { DEBUG and print " Found end of head1. Considering content...\n"; $head1_text_content = uc $head1_text_content if $nocase; @@ -392,9 +399,9 @@ sub _get_titled_section { ? (length($head1_text_content) <= $max_content_length) # sanity : 1) ) { - DEBUG and print " It looks titular: \"$head1_text_content\".\n", - "\n Using that.\n"; - $title = $head1_text_content; + # Looks good; trim it + ($title = $head1_text_content) =~ s/\s+$//; + DEBUG and print " It looks titular: \"$title\".\n\n Using that.\n"; last; } else { --$state; @@ -736,7 +743,7 @@ pod-people@perl.org mail list. Send an empty email to pod-people-subscribe@perl.org to subscribe. This module is managed in an open GitHub repository, -L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or +L<https://github.com/theory/pod-simple/>. Feel free to fork and contribute, or to clone L<git://github.com/theory/pod-simple.git> and send patches! Patches against Pod::Simple are welcome. Please send bug reports to diff --git a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/PullParserEndToken.pm b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/PullParserEndToken.pm index a45aba18bae..5fa402318eb 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/PullParserEndToken.pm +++ b/gnu/usr.bin/perl/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.20'; +$VERSION = '3.28'; sub new { # Class->new(tagname); my $class = shift; @@ -83,7 +83,7 @@ pod-people@perl.org mail list. Send an empty email to pod-people-subscribe@perl.org to subscribe. This module is managed in an open GitHub repository, -L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or +L<https://github.com/theory/pod-simple/>. Feel free to fork and contribute, or to clone L<git://github.com/theory/pod-simple.git> and send patches! Patches against Pod::Simple are welcome. Please send bug reports to diff --git a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/PullParserStartToken.pm b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/PullParserStartToken.pm index e9fbaa2b5ec..3edb0ad5695 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/PullParserStartToken.pm +++ b/gnu/usr.bin/perl/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.20'; +$VERSION = '3.28'; sub new { # Class->new(tagname, optional_attrhash); my $class = shift; @@ -124,7 +124,7 @@ pod-people@perl.org mail list. Send an empty email to pod-people-subscribe@perl.org to subscribe. This module is managed in an open GitHub repository, -L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or +L<https://github.com/theory/pod-simple/>. Feel free to fork and contribute, or to clone L<git://github.com/theory/pod-simple.git> and send patches! Patches against Pod::Simple are welcome. Please send bug reports to diff --git a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/PullParserTextToken.pm b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/PullParserTextToken.pm index 34985fdfb03..a75fd7a706e 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/PullParserTextToken.pm +++ b/gnu/usr.bin/perl/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.20'; +$VERSION = '3.28'; sub new { # Class->new(text); my $class = shift; @@ -91,7 +91,7 @@ pod-people@perl.org mail list. Send an empty email to pod-people-subscribe@perl.org to subscribe. This module is managed in an open GitHub repository, -L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or +L<https://github.com/theory/pod-simple/>. Feel free to fork and contribute, or to clone L<git://github.com/theory/pod-simple.git> and send patches! Patches against Pod::Simple are welcome. Please send bug reports to diff --git a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/PullParserToken.pm b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/PullParserToken.pm index b323ece2a32..bbae51ba69e 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/PullParserToken.pm +++ b/gnu/usr.bin/perl/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.20'; +$VERSION = '3.28'; use strict; sub new { # Class->new('type', stuff...); ## Overridden in derived classes anyway @@ -126,7 +126,7 @@ pod-people@perl.org mail list. Send an empty email to pod-people-subscribe@perl.org to subscribe. This module is managed in an open GitHub repository, -L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or +L<https://github.com/theory/pod-simple/>. Feel free to fork and contribute, or to clone L<git://github.com/theory/pod-simple.git> and send patches! Patches against Pod::Simple are welcome. Please send bug reports to diff --git a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/RTF.pm b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/RTF.pm index 0d184e3a66b..067e6b9dd35 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/RTF.pm +++ b/gnu/usr.bin/perl/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.20'; +$VERSION = '3.28'; use Pod::Simple::PullParser (); BEGIN {@ISA = ('Pod::Simple::PullParser')} @@ -662,7 +662,7 @@ pod-people@perl.org mail list. Send an empty email to pod-people-subscribe@perl.org to subscribe. This module is managed in an open GitHub repository, -L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or +L<https://github.com/theory/pod-simple/>. Feel free to fork and contribute, or to clone L<git://github.com/theory/pod-simple.git> and send patches! Patches against Pod::Simple are welcome. Please send bug reports to diff --git a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/SimpleTree.pm b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/SimpleTree.pm index 3671af121f0..0b42a22b273 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/SimpleTree.pm +++ b/gnu/usr.bin/perl/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.20'; +$VERSION = '3.28'; BEGIN { @ISA = ('Pod::Simple'); *DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG; @@ -143,7 +143,7 @@ pod-people@perl.org mail list. Send an empty email to pod-people-subscribe@perl.org to subscribe. This module is managed in an open GitHub repository, -L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or +L<https://github.com/theory/pod-simple/>. Feel free to fork and contribute, or to clone L<git://github.com/theory/pod-simple.git> and send patches! Patches against Pod::Simple are welcome. Please send bug reports to diff --git a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/Subclassing.pod b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/Subclassing.pod index 792d1be5a24..7a7976bdc47 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/Subclassing.pod +++ b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/Subclassing.pod @@ -12,22 +12,22 @@ Pod::Simple::Subclassing -- write a formatter as a Pod::Simple subclass use strict; sub _handle_element_start { - my($parser, $element_name, $attr_hash_r) = @_; - ... + my($parser, $element_name, $attr_hash_r) = @_; + ... } sub _handle_element_end { - my($parser, $element_name, $attr_hash_r) = @_; - # NOTE: $attr_hash_r is only present when $element_name is "over" or "begin" - # The remaining code excerpts will mostly ignore this $attr_hash_r, as it is - # mostly useless. It is documented where "over-*" and "begin" events are - # documented. - ... + my($parser, $element_name, $attr_hash_r) = @_; + # NOTE: $attr_hash_r is only present when $element_name is "over" or "begin" + # The remaining code excerpts will mostly ignore this $attr_hash_r, as it is + # mostly useless. It is documented where "over-*" and "begin" events are + # documented. + ... } sub _handle_text { - my($parser, $text) = @_; - ... + my($parser, $text) = @_; + ... } 1; @@ -105,13 +105,13 @@ TODO describe Parsing a document produces this event structure: <Document start_line="543"> - ...all events... + ...all events... </Document> The value of the I<start_line> attribute will be the line number of the first Pod directive in the document. -If there is no Pod in the given document, then the +If there is no Pod in the given document, then the event structure will be this: <Document contentless="1" start_line="543"> @@ -126,9 +126,9 @@ last line in the file. Parsing a plain (non-verbatim, non-directive, non-data) paragraph in a Pod document produces this event structure: - <Para start_line="543"> - ...all events in this paragraph... - </Para> + <Para start_line="543"> + ...all events in this paragraph... + </Para> The value of the I<start_line> attribute will be the line number of the start of the paragraph. @@ -140,14 +140,14 @@ For example, parsing this paragraph of Pod: produces this event structure: - <Para start_line="129"> - The value of the - <I> - start_line - </I> - attribute will be the line number of the first Pod directive - in the document. - </Para> + <Para start_line="129"> + The value of the + <I> + start_line + </I> + attribute will be the line number of the first Pod directive + in the document. + </Para> =item events with an element_name of B, C, F, or I. @@ -157,9 +157,9 @@ S<BE<lt>E<lt> ... E<gt>E<gt>>, or S<BE<lt>E<lt>E<lt>E<lt> ... E<gt>E<gt>E<gt>E<gt>>, etc.) produces this event structure: - <B> - ...stuff... - </B> + <B> + ...stuff... + </B> Currently, there are no attributes conveyed. @@ -175,9 +175,9 @@ any attributes. Normally, parsing an SE<lt>...E<gt> sequence produces this event structure, just as if it were a B/C/F/I code: - <S> - ...stuff... - </S> + <S> + ...stuff... + </S> However, Pod::Simple (and presumably all derived parsers) offers the C<nbsp_for_S> option which, if enabled, will suppress all S events, and @@ -191,9 +191,9 @@ means non-breaking space. Normally, parsing an XE<lt>...E<gt> sequence produces this event structure, just as if it were a B/C/F/I code: - <X> - ...stuff... - </X> + <X> + ...stuff... + </X> However, Pod::Simple (and presumably all derived parsers) offers the C<nix_X_codes> option which, if enabled, will suppress all X events @@ -219,7 +219,7 @@ When a LE<lt>I<some_url>E<gt> code is parsed, it produces this event structure: <L content-implicit="yes" raw="that_url" to="that_url" type="url"> - that_url + that_url </L> The C<type="url"> attribute is always specified for this type of @@ -232,14 +232,14 @@ For example, this Pod source: produces this event structure: <L content-implicit="yes" raw="http://www.perl.com/CPAN/authors/" to="http://www.perl.com/CPAN/authors/" type="url"> - http://www.perl.com/CPAN/authors/ + http://www.perl.com/CPAN/authors/ </L> When a LE<lt>I<manpage(section)>E<gt> code is parsed (and these are fairly rare and not terribly useful), it produces this event structure: <L content-implicit="yes" raw="manpage(section)" to="manpage(section)" type="man"> - manpage(section) + manpage(section) </L> The C<type="man"> attribute is always specified for this type of @@ -252,7 +252,7 @@ For example, this Pod source: produces this event structure: <L content-implicit="yes" raw="crontab(5)" to="crontab(5)" type="man"> - crontab(5) + crontab(5) </L> In the rare cases where a man page link has a specified, that text appears @@ -263,7 +263,7 @@ in a I<section> attribute. For example, this Pod source: will produce this event structure: <L content-implicit="yes" raw="crontab(5)/"ENVIRONMENT"" section="ENVIRONMENT" to="crontab(5)" type="man"> - "ENVIRONMENT" in crontab(5) + "ENVIRONMENT" in crontab(5) </L> In the rare case where the Pod document has code like @@ -283,7 +283,7 @@ For example, this Pod source: will produce this event structure: <L raw="hell itself!|crontab(5)" to="crontab(5)" type="man"> - hell itself! + hell itself! </L> The last type of L structure is for links to/within Pod documents. It is @@ -295,7 +295,7 @@ In the most common case, the simple case of a LE<lt>podpageE<gt> code produces this event structure: <L content-implicit="yes" raw="podpage" to="podpage" type="pod"> - podpage + podpage </L> For example, this Pod source: @@ -305,7 +305,7 @@ For example, this Pod source: produces this event structure: <L content-implicit="yes" raw="Net::Ping" to="Net::Ping" type="pod"> - Net::Ping + Net::Ping </L> In cases where there is link-text explicitly specified, it @@ -318,7 +318,7 @@ case discussed above. For example, this Pod source: produces this event structure: <L raw="Perl Error Messages|perldiag" to="perldiag" type="pod"> - Perl Error Messages + Perl Error Messages </L> In cases of links to a section in the current Pod document, @@ -330,7 +330,7 @@ For example, this Pod source: produces this event structure: <L content-implicit="yes" raw="/"Member Data"" section="Member Data" type="pod"> - "Member Data" + "Member Data" </L> As another example, this Pod source: @@ -340,7 +340,7 @@ As another example, this Pod source: produces this event structure: <L raw="the various attributes|/"Member Data"" section="Member Data" type="pod"> - the various attributes + the various attributes </L> In cases of links to a section in a different Pod document, @@ -352,7 +352,7 @@ For example, this Pod source: produces this event structure: <L content-implicit="yes" raw="perlsyn/"Basic BLOCKs and Switch Statements"" section="Basic BLOCKs and Switch Statements" to="perlsyn" type="pod"> - "Basic BLOCKs and Switch Statements" in perlsyn + "Basic BLOCKs and Switch Statements" in perlsyn </L> As another example, this Pod source: @@ -362,7 +362,7 @@ As another example, this Pod source: produces this event structure: <L raw="SWITCH statements|perlsyn/"Basic BLOCKs and Switch Statements"" section="Basic BLOCKs and Switch Statements" to="perlsyn" type="pod"> - SWITCH statements + SWITCH statements </L> Incidentally, note that we do not distinguish between these syntaxes: @@ -375,21 +375,21 @@ Incidentally, note that we do not distinguish between these syntaxes: That is, they all produce the same event structure (for the most part), namely: <L content-implicit="yes" raw="$depends_on_syntax" section="Member Data" type="pod"> - "Member Data" + "Member Data" </L> -The I<raw> attribute depends on what the raw content of the L<> is, so that is -why the event structure is the same "for the most part". +The I<raw> attribute depends on what the raw content of the C<LE<lt>E<gt>> is, +so that is why the event structure is the same "for the most part". If you have not guessed it yet, the I<raw> attribute contains the raw, -original, unescaped content of the L<> formatting code. In addition to the -examples above, take notice of the following event structure produced by -the following L<> formatting code. +original, unescaped content of the C<LE<lt>E<gt>> formatting code. In addition +to the examples above, take notice of the following event structure produced +by the following C<LE<lt>E<gt>> formatting code. L<click B<here>|page/About the C<-M> switch> <L raw="click B<here>|page/About the C<-M> switch" section="About the -M switch" to="page" type="pod"> - click B<here> + click B<here> </L> Specifically, notice that the formatting codes are present and unescaped @@ -411,7 +411,7 @@ When a Pod verbatim paragraph (AKA "codeblock") is parsed, it produces this event structure: <Verbatim start_line="543" xml:space="preserve"> - ...text... + ...text... </Verbatim> The value of the I<start_line> attribute will be the line number of the @@ -427,7 +427,7 @@ When a "=head1 ..." directive is parsed, it produces this event structure: <head1> - ...stuff... + ...stuff... </head1> For example, a directive consisting of this: @@ -437,26 +437,33 @@ For example, a directive consisting of this: will produce this event structure: <head1 start_line="543"> - Options to - <C> - new - </C> - et al. + Options to + <C> + new + </C> + et al. </head1> "=head2" thru "=head4" directives are the same, except for the element names in the event structure. +=item events with an element_name of encoding + +In the default case, the events corresponding to C<=encoding> directives +are not emitted. They are emitted if C<keep_encoding_directive> is true. +In that case they produce event structures like +L</"events with an element_name of head1 .. head4"> above. + =item events with an element_name of over-bullet When an "=over ... Z<>=back" block is parsed where the items are a bulleted list, it will produce this event structure: <over-bullet indent="4" start_line="543"> - <item-bullet start_line="545"> - ...Stuff... - </item-bullet> - ...more item-bullets... + <item-bullet start_line="545"> + ...Stuff... + </item-bullet> + ...more item-bullets... </over-bullet fake-closer="1"> The attribute I<fake-closer> is only present if it is a true value; it is not @@ -509,12 +516,12 @@ For example, this Pod source: produces this event structure: <over-bullet indent="4" start_line="10"> - <item-bullet start_line="12"> - Stuff - </item-bullet> - <item-bullet start_line="14"> - Bar <I>baz</I>! - </item-bullet> + <item-bullet start_line="12"> + Stuff + </item-bullet> + <item-bullet start_line="14"> + Bar <I>baz</I>! + </item-bullet> </over-bullet> =item events with an element_name of over-number @@ -523,10 +530,10 @@ When an "=over ... Z<>=back" block is parsed where the items are a numbered list, it will produce this event structure: <over-number indent="4" start_line="543"> - <item-number number="1" start_line="545"> - ...Stuff... - </item-number> - ...more item-number... + <item-number number="1" start_line="545"> + ...Stuff... + </item-number> + ...more item-number... </over-bullet> This is like the "over-bullet" event structure; but note that the contents @@ -550,12 +557,12 @@ an "=over ... Z<>=back" block is parsed where the items are a list of text "subheadings", it will produce this event structure: <over-text indent="4" start_line="543"> - <item-text> - ...stuff... - </item-text> - ...stuff (generally Para or Verbatim elements)... - <item-text> - ...more item-text and/or stuff... + <item-text> + ...stuff... + </item-text> + ...stuff (generally Para or Verbatim elements)... + <item-text> + ...more item-text and/or stuff... </over-text> The I<indent> and I<fake-closer> attributes are as with the other over-* events. @@ -577,22 +584,22 @@ For example, this Pod source: produces this event structure: <over-text indent="4" start_line="20"> - <item-text start_line="22"> - Foo - </item-text> - <Para start_line="24"> - Stuff - </Para> - <item-text start_line="26"> - Bar - <I> - baz - </I> - ! - </item-text> - <Para start_line="28"> - Quux - </Para> + <item-text start_line="22"> + Foo + </item-text> + <Para start_line="24"> + Stuff + </Para> + <item-text start_line="26"> + Bar + <I> + baz + </I> + ! + </item-text> + <Para start_line="28"> + Quux + </Para> </over-text> @@ -605,7 +612,7 @@ an "=over ... Z<>=back" block is parsed where there are no items, it will produce this event structure: <over-block indent="4" start_line="543"> - ...stuff (generally Para or Verbatim elements)... + ...stuff (generally Para or Verbatim elements)... </over-block> The I<indent> and I<fake-closer> attributes are as with the other over-* events. @@ -628,15 +635,15 @@ For example, this Pod source: will produce this event structure: <over-block indent="4" start_line="2"> - <Para start_line="4"> - For cutting off our trade with all parts of the world - </Para> - <Para start_line="6"> - For transporting us beyond seas to be tried for pretended offenses - </Para> - <Para start_line="8"> - He is at this time transporting large armies of [...more text...] - </Para> + <Para start_line="4"> + For cutting off our trade with all parts of the world + </Para> + <Para start_line="6"> + For transporting us beyond seas to be tried for pretended offenses + </Para> + <Para start_line="8"> + He is at this time transporting large armies of [...more text...] + </Para> </over-block> =item events with an element_name of over-empty @@ -666,12 +673,12 @@ For example, this Pod source: will produce this event structure: <over-block indent="4" start_line="1"> - <over-empty indent="4" start_line="3"> - </over-empty> + <over-empty indent="4" start_line="3"> + </over-empty> </over-block> Note that the outer C<=over> is a block because it has no C<=item>s but still -has content: the inner C<=over>. The inner C<=over>, in turn, is completely +has content: the inner C<=over>. The inner C<=over>, in turn, is completely empty, and is treated as such. =item events with an element_name of item-bullet @@ -714,21 +721,21 @@ the ones described in the I<perlpod>. As the parser sees sections like: - =for html <img src="fig1.jpg"> + =for html <img src="fig1.jpg"> or - =begin html + =begin html - <img src="fig1.jpg"> + <img src="fig1.jpg"> - =end html + =end html ...the parser will ignore these sections unless your subclass has -specified that it wants to see sections targetted to "html" (or whatever +specified that it wants to see sections targeted to "html" (or whatever the formatter name is). -If you want to process all sections, even if they're not targetted for you, +If you want to process all sections, even if they're not targeted for you, call this before you start parsing: $parser->accept_targets('*'); @@ -749,7 +756,7 @@ beyond just the standard ones (I B C L F S X, plus the two weird ones you don't actually see in the parse tree, Z and E). For example, to also accept codes "N", "R", and "W": - $parser->accept_codes( qw( N R W ) ); + $parser->accept_codes( qw( N R W ) ); B<TODO: document how this interacts with =extend, and long element names> @@ -769,11 +776,11 @@ all), or as verbatim (mostly just expanding tabs), or as processed text For example, to accept a new directive "=method", you'd presumably use: - $parser->accept_directive_as_processed("method"); + $parser->accept_directive_as_processed("method"); so that you could have Pod lines like: - =method I<$whatever> thing B<um> + =method I<$whatever> thing B<um> Making up your own directives breaks compatibility with other Pod formatters, in a way that using "=for I<target> ..." lines doesn't; @@ -787,11 +794,11 @@ Setting this attribute to a true value (and by default it is false) will turn "SE<lt>...E<gt>" sequences into sequences of words separated by C<\xA0> (non-breaking space) characters. For example, it will take this: - I like S<Dutch apple pie>, don't you? + I like S<Dutch apple pie>, don't you? and treat it as if it were: - I like DutchE<nbsp>appleE<nbsp>pie, don't you? + I like DutchE<nbsp>appleE<nbsp>pie, don't you? This is handy for output formats that don't have anything quite like an "SE<lt>...E<gt>" code, but which do have a code for non-breaking space. @@ -808,7 +815,7 @@ L<perlpodspec> requires output formats (wherever possible) to note this detail in a comment in the output format. For example, for some kind of SGML output format: - print OUT "<!-- \n", $parser->version_report, "\n -->"; + print OUT "<!-- \n", $parser->version_report, "\n -->"; =item C<< $parser->pod_para_count() >> @@ -829,6 +836,15 @@ ignores any "XE<lt>...E<gt>" sequences in the document being parsed. Many formats don't actually use the content of these codes, so have no reason to process them. +=item C<< $parser->keep_encoding_directive( I<SOMEVALUE> ) >> + +This attribute, when set to a true value (it is false by default) +will keep C<=encoding> and its content in the event structure. Most +formats don't actually need to process the content of an C<=encoding> +directive, even when this directive sets the encoding and the +processor makes use of the encoding information. Indeed, it is +possible to know the encoding without processing the directive +content. =item C<< $parser->merge_text( I<SOMEVALUE> ) >> @@ -837,7 +853,7 @@ makes sure that only one event (or token, or node) will be created for any single contiguous sequence of text. For example, consider this somewhat contrived example: - I just LOVE Z<>hotE<32>apple pie! + I just LOVE Z<>hotE<32>apple pie! When that is parsed and events are about to be called on it, it may actually seem to be four different text events, one right after another: @@ -853,10 +869,10 @@ This specifies code that should be called when a code line is seen that no code should be called. If you provide a routine, it should start out like this: - sub get_code_line { # or whatever you'll call it - my($line, $line_number, $parser) = @_; - ... - } + sub get_code_line { # or whatever you'll call it + my($line, $line_number, $parser) = @_; + ... + } Note, however, that sometimes the Pod events aren't processed in exactly the same order as the code lines are -- i.e., if you have a file with @@ -1011,7 +1027,7 @@ pod-people@perl.org mail list. Send an empty email to pod-people-subscribe@perl.org to subscribe. This module is managed in an open GitHub repository, -L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or +L<https://github.com/theory/pod-simple/>. Feel free to fork and contribute, or to clone L<git://github.com/theory/pod-simple.git> and send patches! Patches against Pod::Simple are welcome. Please send bug reports to @@ -1053,5 +1069,3 @@ Yes, L<...> is hard. =cut - - diff --git a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/Text.pm b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/Text.pm index 3032d0fcd57..bd1a5416df8 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/Text.pm +++ b/gnu/usr.bin/perl/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.20'; +$VERSION = '3.28'; @ISA = ('Pod::Simple::Methody'); BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG) ? \&Pod::Simple::DEBUG @@ -148,7 +148,7 @@ pod-people@perl.org mail list. Send an empty email to pod-people-subscribe@perl.org to subscribe. This module is managed in an open GitHub repository, -L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or +L<https://github.com/theory/pod-simple/>. Feel free to fork and contribute, or to clone L<git://github.com/theory/pod-simple.git> and send patches! Patches against Pod::Simple are welcome. Please send bug reports to diff --git a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm index dea1cde7ccf..6788df6d762 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm +++ b/gnu/usr.bin/perl/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.20'; +$VERSION = '3.28'; @ISA = ('Pod::Simple'); sub new { @@ -75,7 +75,7 @@ pod-people@perl.org mail list. Send an empty email to pod-people-subscribe@perl.org to subscribe. This module is managed in an open GitHub repository, -L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or +L<https://github.com/theory/pod-simple/>. Feel free to fork and contribute, or to clone L<git://github.com/theory/pod-simple.git> and send patches! Patches against Pod::Simple are welcome. Please send bug reports to diff --git a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/TiedOutFH.pm b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/TiedOutFH.pm index 9f2a224a278..0b2fb2f8c49 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/TiedOutFH.pm +++ b/gnu/usr.bin/perl/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.20'; +$VERSION = '3.28'; #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/Transcode.pm b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/Transcode.pm index 892436db7f0..9e835048a0e 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/Transcode.pm +++ b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/Transcode.pm @@ -2,7 +2,7 @@ require 5; package Pod::Simple::Transcode; use vars qw($VERSION ); -$VERSION = '3.20'; +$VERSION = '3.28'; BEGIN { if(defined &DEBUG) {;} # Okay diff --git a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/TranscodeDumb.pm b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/TranscodeDumb.pm index 33030903430..4749e9af198 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/TranscodeDumb.pm +++ b/gnu/usr.bin/perl/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.20'; +$VERSION = '3.28'; # 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/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/TranscodeSmart.pm b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/TranscodeSmart.pm index a66dedd03bc..06fdb9f2750 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/TranscodeSmart.pm +++ b/gnu/usr.bin/perl/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.20'; +$VERSION = '3.28'; sub is_dumb {0} sub is_smart {1} @@ -27,12 +27,12 @@ sub encmodver { } sub make_transcoder { - my($e) = $_[1]; + my $e = Encode::find_encoding($_[1]); die "WHAT ENCODING!?!?" unless $e; my $x; return sub { foreach $x (@_) { - $x = Encode::decode($e, $x); + $x = $e->decode($x) unless Encode::is_utf8($x); } return; }; diff --git a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/XHTML.pm b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/XHTML.pm index 9d31db0badd..df896e64a7c 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/XHTML.pm +++ b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/XHTML.pm @@ -45,7 +45,7 @@ declare the output character set as UTF-8 before parsing, like so: package Pod::Simple::XHTML; use strict; use vars qw( $VERSION @ISA $HAS_HTML_ENTITIES ); -$VERSION = '3.20'; +$VERSION = '3.28'; use Pod::Simple::Methody (); @ISA = ('Pod::Simple::Methody'); @@ -151,7 +151,7 @@ Add additional meta tags here, or blocks of inline CSS or JavaScript A string containing all characters that should be encoded as HTML entities, specified using the regular expression character class syntax (what you find within brackets in regular expressions). This value will be passed as the -second argument to the C<encode_entities> fuction of L<HTML::Entities>. IF +second argument to the C<encode_entities> function of L<HTML::Entities>. If L<HTML::Entities> is not installed, then any characters other than C<&<>"'> will be encoded numerically. @@ -251,7 +251,6 @@ sub new { $new->man_url_prefix('http://man.he.net/man'); $new->html_charset('ISO-8859-1'); $new->nix_X_codes(1); - $new->codes_in_verbatim(1); $new->{'scratch'} = ''; $new->{'to_index'} = []; $new->{'output'} = []; @@ -301,11 +300,27 @@ something like: my ($self, $text) = @_; if ($self->{'in_foo'}) { $self->{'scratch'} .= build_foo_html($text); - } else { - $self->{'scratch'} .= $text; + return; } + $self->SUPER::handle_text($text); } +=head2 handle_code + +This method handles the body of text that is marked up to be code. +You might for instance override this to plug in a syntax highlighter. +The base implementation just escapes the text. + +The callback methods C<start_code> and C<end_code> emits the C<code> tags +before and after C<handle_code> is invoked, so you might want to override these +together with C<handle_code> if this wrapping isn't suiteable. + +Note that the code might be broken into mulitple segments if there are +nested formatting codes inside a C<< CE<lt>...> >> sequence. In between the +calls to C<handle_code> other markup tags might have been emitted in that +case. The same is true for verbatim sections if the C<codes_in_verbatim> +option is turned on. + =head2 accept_targets_as_html This method behaves like C<accept_targets_as_text>, but also marks the region @@ -328,18 +343,47 @@ sub accept_targets_as_html { sub handle_text { # escape special characters in HTML (<, >, &, etc) - $_[0]{'scratch'} .= $_[0]->__in_literal_xhtml_region - ? $_[1] - : $_[0]->encode_entities( $_[1] ); + my $text = $_[0]->__in_literal_xhtml_region + ? $_[1] + : $_[0]->encode_entities( $_[1] ); + + if ($_[0]{'in_code'} && @{$_[0]{'in_code'}}) { + # Intentionally use the raw text in $_[1], even if we're not in a + # literal xhtml region, since handle_code calls encode_entities. + $_[0]->handle_code( $_[1], $_[0]{'in_code'}[-1] ); + } else { + $_[0]{'scratch'} .= $text; + } + + $_[0]{htext} .= $text if $_[0]{'in_head'}; } -sub start_Para { $_[0]{'scratch'} = '<p>' } -sub start_Verbatim { $_[0]{'scratch'} = '<pre><code>' } +sub start_code { + $_[0]{'scratch'} .= '<code>'; +} -sub start_head1 { $_[0]{'in_head'} = 1 } -sub start_head2 { $_[0]{'in_head'} = 2 } -sub start_head3 { $_[0]{'in_head'} = 3 } -sub start_head4 { $_[0]{'in_head'} = 4 } +sub end_code { + $_[0]{'scratch'} .= '</code>'; +} + +sub handle_code { + $_[0]{'scratch'} .= $_[0]->encode_entities( $_[1] ); +} + +sub start_Para { + $_[0]{'scratch'} = '<p>'; +} + +sub start_Verbatim { + $_[0]{'scratch'} = '<pre>'; + push(@{$_[0]{'in_code'}}, 'Verbatim'); + $_[0]->start_code($_[0]{'in_code'}[-1]); +} + +sub start_head1 { $_[0]{'in_head'} = 1; $_[0]{htext} = ''; } +sub start_head2 { $_[0]{'in_head'} = 2; $_[0]{htext} = ''; } +sub start_head3 { $_[0]{'in_head'} = 3; $_[0]{htext} = ''; } +sub start_head4 { $_[0]{'in_head'} = 4; $_[0]{htext} = ''; } sub start_item_number { $_[0]{'scratch'} = "</li>\n" if ($_[0]{'in_li'}->[-1] && pop @{$_[0]{'in_li'}}); @@ -397,7 +441,8 @@ sub end_over_text { sub end_Para { $_[0]{'scratch'} .= '</p>'; $_[0]->emit } sub end_Verbatim { - $_[0]{'scratch'} .= '</code></pre>'; + $_[0]->end_code(pop(@{$_[0]->{'in_code'}})); + $_[0]{'scratch'} .= '</pre>'; $_[0]->emit; } @@ -408,14 +453,14 @@ sub _end_head { $add = 1 unless defined $add; $h += $add - 1; - my $id = $_[0]->idify($_[0]{scratch}); + my $id = $_[0]->idify($_[0]{htext}); my $text = $_[0]{scratch}; - $_[0]{'scratch'} = $_[0]->backlink && ($h - $add == 0) + $_[0]{'scratch'} = $_[0]->backlink && ($h - $add == 0) # backlinks enabled && =head1 ? qq{<a href="#_podtop_"><h$h id="$id">$text</h$h></a>} : qq{<h$h id="$id">$text</h$h>}; $_[0]->emit; - push @{ $_[0]{'to_index'} }, [$h, $id, $text]; + push @{ $_[0]{'to_index'} }, [$h, $id, delete $_[0]{'htext'}]; } sub end_head1 { shift->_end_head(@_); } @@ -568,8 +613,8 @@ sub end_Document { sub start_B { $_[0]{'scratch'} .= '<b>' } sub end_B { $_[0]{'scratch'} .= '</b>' } -sub start_C { $_[0]{'scratch'} .= '<code>' } -sub end_C { $_[0]{'scratch'} .= '</code>' } +sub start_C { push(@{$_[0]{'in_code'}}, 'C'); $_[0]->start_code($_[0]{'in_code'}[-1]); } +sub end_C { $_[0]->end_code(pop(@{$_[0]{'in_code'}})); } sub start_F { $_[0]{'scratch'} .= '<i>' } sub end_F { $_[0]{'scratch'} .= '</i>' } @@ -692,6 +737,11 @@ underscores (_), colons (:), and periods (.). =item * +The final character can't be a hyphen, colon, or period. URLs ending with these +characters, while allowed by XHTML, can be awkward to extract from plain text. + +=item * + Each id must be unique within the document. =back @@ -713,6 +763,7 @@ sub idify { s/^([^a-zA-Z]+)$/pod$1/; # Prepend "pod" if no valid chars. s/^[^a-zA-Z]+//; # First char must be a letter. s/[^-a-zA-Z0-9_:.]+/-/g; # All other chars must be valid. + s/[-:.]+$//; # Strip trailing punctuation. } return $t if $not_unique; my $i = ''; @@ -757,7 +808,7 @@ pod-people@perl.org mail list. Send an empty email to pod-people-subscribe@perl.org to subscribe. This module is managed in an open GitHub repository, -L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or +L<https://github.com/theory/pod-simple/>. Feel free to fork and contribute, or to clone L<git://github.com/theory/pod-simple.git> and send patches! Patches against Pod::Simple are welcome. Please send bug reports to diff --git a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/XMLOutStream.pm b/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/XMLOutStream.pm index bbb815a5527..47496e2577f 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/XMLOutStream.pm +++ b/gnu/usr.bin/perl/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.20'; +$VERSION = '3.28'; BEGIN { @ISA = ('Pod::Simple'); *DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG; @@ -20,6 +20,7 @@ sub new { my $self = shift; my $new = $self->SUPER::new(@_); $new->{'output_fh'} ||= *STDOUT{IO}; + $new->keep_encoding_directive(1); #$new->accept_codes('VerbatimFormatted'); return $new; } @@ -148,7 +149,7 @@ pod-people@perl.org mail list. Send an empty email to pod-people-subscribe@perl.org to subscribe. This module is managed in an open GitHub repository, -L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or +L<https://github.com/theory/pod-simple/>. Feel free to fork and contribute, or to clone L<git://github.com/theory/pod-simple.git> and send patches! Patches against Pod::Simple are welcome. Please send bug reports to |