summaryrefslogtreecommitdiff
path: root/cpan/Pod-Simple/lib/Pod/Simple.pm
diff options
context:
space:
mode:
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>2013-02-28 15:23:20 +0000
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>2013-02-28 15:23:20 +0000
commit9dd0d3936597070001bcc933b4415b1e113437ee (patch)
treecb85120b6b1adf61bb2bfbaea4cf84980a714ef3 /cpan/Pod-Simple/lib/Pod/Simple.pm
parent46b428ce5128df764ce460c744a3c4f0f9727b5b (diff)
downloadperl-9dd0d3936597070001bcc933b4415b1e113437ee.tar.gz
Update Pod-Simple to CPAN version 3.26
[DELTA] 2013-02-27 David E. Wheeler <david@justatheory.org> * Release 3.26 Fixed another test script to skip all tests when Encode is not installed. Added 'encoding()' and 'detected_encoding()' to return the current encoding and the encoding actually to decode the input file. The value from "=encoding" is also now kept in the output tree. Patch from Patrice Dumas (RT #74390). 2013-02-16 David E. Wheeler <david@justatheory.org> * Release 3.25 Improved the warning when "=item" types mismatch within one "=over"/"=back" block. 2013-02-14 David E. Wheeler <david@justatheory.org> * Release 3.24 Fixed corner case bug for unlikely scenario in which non-UTF-8 text could be parsed as UTF-8. Grant McLean. XHTML IDs can no longer end with punctuation. Thanks to Smylers for the patch. Fixed test failure on Perl 5.6.2. Changed the default installation location from "perl" to "site" on 5.12 and higher, since as of that version of Perl, dual-life modules no longer need to be installed in "perl" to replace in-core versions. Patch from tzccinct. Fixed hash order dependency test failures on Perl 5.17. Thanks to Yves Orton for the patch. Inlined the code that tries to guess a Pod file's encoding. This reduces the time Pod::Simple takes to build the core Perl documentation by 15-20%. Thanks to Dagfinn Ilmari Mannsåker for the patch! Added a warning when "=item" types mismatch within one "=over"/"=back" block. Marc Green/Google Summer of Code, with assist from RJBS. Fixed regression introduced in 3.22 in which "C< >" tags were incorrectly treated as verbatim text in table of contents items emitted by Pod::Simple::XHTML. Thanks to Randy Stauner for the report and to Thomas Sibley for the fix! Loosened up the matching of "L< >" tags for man pages so that they allow names with dots, underscores, and any other chararacters other than "/", just so long as they end in '[(][-a-zA-Z0-9]+[)]'. Thanks to Dave Rolsky and Kevin Ryde for the reports (RT #82975 & RT #82972). Fixed inverted mapping of "keyboard" to "kbd" in Pod::Simple::HTML. Thanks to Robert Boisvert for the bug report (RT #79201). Added two new Tagmap entries to Pod::Simple::HTML: "preformat" maps to "pre", and "teletype" maps to "tt". Suggested by Robert Boisvert (RT #79201). "X< >" tags are now ignored by the pull parser when it searches for titles, as is any trailing whitespace. Thanks to Patrice Dumas for the report (RT #74389).
Diffstat (limited to 'cpan/Pod-Simple/lib/Pod/Simple.pm')
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple.pm35
1 files changed, 32 insertions, 3 deletions
diff --git a/cpan/Pod-Simple/lib/Pod/Simple.pm b/cpan/Pod-Simple/lib/Pod/Simple.pm
index fead5b5232..f1c7625a64 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.23';
+$VERSION = '3.26';
@Known_formatting_codes = qw(I B C L E F S X Z);
%Known_formatting_codes = map(($_=>1), @Known_formatting_codes);
@@ -113,6 +113,35 @@ sub any_errata_seen { # good for using as an exit() value...
return shift->{'errors_seen'} || 0;
}
+# Returns the encoding only if it was recognized as being handled and set
+sub detected_encoding {
+ return shift->{'detected_encoding'};
+}
+
+sub encoding {
+ my $this = shift;
+ return $this->{'encoding'} unless @_; # GET.
+
+ $this->_handle_encoding_line("=encoding $_[0]");
+ if ($this->{'_processed_encoding'}) {
+ delete $this->{'_processed_encoding'};
+ if(! $this->{'encoding_command_statuses'} ) {
+ DEBUG > 2 and print " CRAZY ERROR: encoding wasn't really handled?!\n";
+ } elsif( $this->{'encoding_command_statuses'}[-1] ) {
+ $this->scream( "=encoding $_[0]",
+ sprintf "Couldn't do %s: %s",
+ $this->{'encoding_command_reqs' }[-1],
+ $this->{'encoding_command_statuses'}[-1],
+ );
+ } else {
+ DEBUG > 2 and print " (encoding successfully handled.)\n";
+ }
+ return $this->{'encoding'};
+ } else {
+ return undef;
+ }
+}
+
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
# Pull in some functions that, for some reason, I expect to see here too:
BEGIN {
@@ -1094,7 +1123,7 @@ sub _treat_Ls { # Process our dear dear friends, the L<...> sequences
# Catch some very simple and/or common cases
if(@{$ell} == 3 and ! ref $ell->[2]) {
my $it = $ell->[2];
- if($it =~ m/^[-a-zA-Z0-9]+\([-a-zA-Z0-9]+\)$/s) { # man sections
+ if($it =~ m{^[^/|]+[(][-a-zA-Z0-9]+[)]$}s) { # man sections
# Hopefully neither too broad nor too restrictive a RE
DEBUG > 1 and print "Catching \"$it\" as manpage link.\n";
$ell->[1]{'type'} = 'man';
@@ -1253,7 +1282,7 @@ sub _treat_Ls { # Process our dear dear friends, the L<...> sequences
# And the E resolver will have to deal with all our treeletty things:
if(@ell_content == 1 and !ref($ell_content[0])
- and $ell_content[0] =~ m/^[-a-zA-Z0-9]+\([-a-zA-Z0-9]+\)$/s
+ and $ell_content[0] =~ m{^[^/]+[(][-a-zA-Z0-9]+[)]$}s
) {
$ell->[1]{'type'} = 'man';
DEBUG > 3 and print "Considering this ($ell_content[0]) a man link.\n";