From: Gurusamy Sarathy Date: Thu, 7 Oct 1999 15:12:24 +0000 (+0000) Subject: update to podlators-0.08 from Russ Allbery X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2e20e14f06deb037c08540fe454d89e37322092d;p=p5sagit%2Fp5-mst-13.2.git update to podlators-0.08 from Russ Allbery p4raw-id: //depot/perl@4307 --- diff --git a/lib/Pod/Man.pm b/lib/Pod/Man.pm index 7a1c69f..a85fba5 100644 --- a/lib/Pod/Man.pm +++ b/lib/Pod/Man.pm @@ -1,5 +1,5 @@ # Pod::Man -- Convert POD data to formatted *roff input. -# $Id: Man.pm,v 0.5 1999/09/25 19:49:49 eagle Exp $ +# $Id: Man.pm,v 0.8 1999/10/07 09:39:37 eagle Exp $ # # Copyright 1999 by Russ Allbery # @@ -28,7 +28,7 @@ use vars qw(@ISA %ESCAPES $PREAMBLE $VERSION); @ISA = qw(Pod::Parser); -($VERSION = (split (' ', q$Revision: 0.5 $ ))[1]) =~ s/\.(\d)$/.0$1/; +($VERSION = (split (' ', q$Revision: 0.8 $ ))[1]) =~ s/\.(\d)$/.0$1/; ############################################################################ @@ -525,7 +525,9 @@ sub sequence { # Handle E<> escapes. if ($command eq 'E') { - if (exists $ESCAPES{$_}) { + if (/^\d+$/) { + return bless \ chr ($_), 'Pod::Man::String'; + } elsif (exists $ESCAPES{$_}) { return bless \ "$ESCAPES{$_}", 'Pod::Man::String'; } else { carp "Unknown escape E<$1>"; @@ -745,7 +747,8 @@ sub buildlink { $text .= (length $manpage) ? " in $manpage" : " elsewhere in this document"; } else { - $text .= 'the section on "' . $section . '"'; + if ($section !~ /^".*"$/) { $section = '"' . $section . '"' } + $text .= 'the section on ' . $section; $text .= " in $manpage" if length $manpage; } $text; diff --git a/lib/Pod/Text.pm b/lib/Pod/Text.pm index 165dd5d..1425ea2 100644 --- a/lib/Pod/Text.pm +++ b/lib/Pod/Text.pm @@ -1,5 +1,5 @@ # Pod::Text -- Convert POD data to formatted ASCII text. -# $Id: Text.pm,v 2.1 1999/09/20 11:53:33 eagle Exp $ +# $Id: Text.pm,v 2.3 1999/10/07 09:41:57 eagle Exp $ # # Copyright 1999 by Russ Allbery # @@ -20,16 +20,20 @@ package Pod::Text; require 5.004; use Carp qw(carp croak); +use Exporter (); use Pod::Select (); use strict; -use vars qw(@ISA %ESCAPES $VERSION); +use vars qw(@ISA @EXPORT %ESCAPES $VERSION); # We inherit from Pod::Select instead of Pod::Parser so that we can be used # by Pod::Usage. -@ISA = qw(Pod::Select); +@ISA = qw(Pod::Select Exporter); -($VERSION = (split (' ', q$Revision: 2.1 $ ))[1]) =~ s/\.(\d)$/.0$1/; +# We have to export pod2text for backward compatibility. +@EXPORT = qw(pod2text); + +($VERSION = (split (' ', q$Revision: 2.3 $ ))[1]) =~ s/\.(\d)$/.0$1/; ############################################################################ @@ -235,9 +239,13 @@ sub interior_sequence { # Expand escapes into the actual character now, carping if invalid. if ($command eq 'E') { - return $ESCAPES{$_} if defined $ESCAPES{$_}; - carp "Unknown escape: E<$_>"; - return "E<$_>"; + if (/^\d+$/) { + return chr; + } else { + return $ESCAPES{$_} if defined $ESCAPES{$_}; + carp "Unknown escape: E<$_>"; + return "E<$_>"; + } } # For all the other sequences, empty content produces no output. diff --git a/pod/pod2man.PL b/pod/pod2man.PL index 68d0c42..4312e9f 100644 --- a/pod/pod2man.PL +++ b/pod/pod2man.PL @@ -69,7 +69,7 @@ if ($options{official} && !defined $options{center}) { } # Initialize and run the formatter. -my $parser = Pod::Man->new (\%options); +my $parser = Pod::Man->new (%options); $parser->parse_from_file (@ARGV); __END__