From: Rafael Garcia-Suarez Date: Thu, 29 Nov 2007 10:21:22 +0000 (+0000) Subject: Upgrade to podlators 2.0.6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=40dcca8acfd632ef78333419c9eb620512621633;p=p5sagit%2Fp5-mst-13.2.git Upgrade to podlators 2.0.6 p4raw-id: //depot/perl@32551 --- diff --git a/lib/Pod/Man.pm b/lib/Pod/Man.pm index a8b41bb..451ecc8 100644 --- a/lib/Pod/Man.pm +++ b/lib/Pod/Man.pm @@ -1,7 +1,7 @@ # Pod::Man -- Convert POD data to formatted *roff input. -# $Id: Man.pm,v 2.12 2006-09-16 20:55:41 eagle Exp $ +# $Id: Man.pm,v 2.16 2007-11-29 01:35:53 eagle Exp $ # -# Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +# Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 # Russ Allbery # Substantial contributions by Sean Burke # @@ -40,7 +40,7 @@ use POSIX qw(strftime); # Don't use the CVS revision as the version, since this module is also in Perl # core and too many things could munge CVS magic revision strings. This # number should ideally be the same as the CVS revision in podlators, however. -$VERSION = '2.12_01'; +$VERSION = '2.16'; # Set the debugging level. If someone has inserted a debug function into this # class already, use that. Otherwise, use any Pod::Simple debug function @@ -333,6 +333,7 @@ sub formatting { $options{cleanup} = 0; } elsif ($element eq 'Verbatim' || $element eq 'C') { $options{guesswork} = 0; + $options{literal} = 1; } return \%options; } @@ -345,6 +346,7 @@ sub format_text { my $guesswork = $$options{guesswork} && !$$self{IN_NAME}; my $cleanup = $$options{cleanup}; my $convert = $$options{convert}; + my $literal = $$options{literal}; # Normally we do character translation, but we won't even do that in # blocks. @@ -363,6 +365,13 @@ sub format_text { $text =~ s/_(?=_)/_\\|/g; } + # Ensure that *roff doesn't convert literal quotes to UTF-8 single quotes, + # but don't mess up our accept escapes. + if ($literal) { + $text =~ s/(? )? \(\s*[^\s,]\s*\) # 0/1-arg func call @@ -791,13 +801,10 @@ sub devise_title { my @dirs = File::Spec->splitdir ($dirs); my $cut = 0; my $i; - for ($i = 0; $i < scalar @dirs; $i++) { - if ($dirs[$i] eq 'lib' && $i+1 < scalar(@dirs) && $dirs[$i + 1] =~ /perl/) { - $cut = $i + 2; - last; - } elsif ($dirs[$i] =~ /perl/) { + for ($i = 0; $i < @dirs; $i++) { + if ($dirs[$i] =~ /perl/) { $cut = $i + 1; - $cut++ if $dirs[$i + 1] eq 'lib'; + $cut++ if ($dirs[$i + 1] && $dirs[$i + 1] eq 'lib'); last; } } @@ -1346,17 +1353,25 @@ sub preamble_template { . ds R" '' 'br\} .\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. -.if \nF \{\ +.ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} +.el \{\ +. de IX +.. +.\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. @@ -1657,7 +1672,7 @@ mine). =head1 COPYRIGHT AND LICENSE -Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by Russ Allbery . This program is free software; you may redistribute it and/or modify it diff --git a/lib/Pod/t/basic.man b/lib/Pod/t/basic.man index a60a0aa..9c2248e 100644 --- a/lib/Pod/t/basic.man +++ b/lib/Pod/t/basic.man @@ -230,7 +230,7 @@ the first < seen. Lets make sure these work for empty ones too, like \f(CW\*(C`\*(C'\fR and \f(CW\*(C`>>\*(C'\fR (just to be obnoxious) .PP -The statement: \f(CW\*(C`This is dog kind's \f(CIfinest\f(CW hour!\*(C'\fR is a parody of a +The statement: \f(CW\*(C`This is dog kind\*(Aqs \f(CIfinest\f(CW hour!\*(C'\fR is a parody of a quotation from Winston Churchill. .PP The following tests are added to those: @@ -264,16 +264,16 @@ Throw in a few verbatim paragraphs. .PP .Vb 8 \& use Term::ANSIColor; -\& print color 'bold blue'; +\& print color \*(Aqbold blue\*(Aq; \& print "This text is bold blue.\en"; -\& print color 'reset'; +\& print color \*(Aqreset\*(Aq; \& print "This text is normal.\en"; -\& print colored ("Yellow on magenta.\en", 'yellow on_magenta'); +\& print colored ("Yellow on magenta.\en", \*(Aqyellow on_magenta\*(Aq); \& print "This text is normal.\en"; -\& print colored ['yellow on_magenta'], "Yellow on magenta.\en"; +\& print colored [\*(Aqyellow on_magenta\*(Aq], "Yellow on magenta.\en"; \& \& use Term::ANSIColor qw(uncolor); -\& print uncolor '01;31', "\en"; +\& print uncolor \*(Aq01;31\*(Aq, "\en"; .Ve .PP But this isn't verbatim (make sure it wraps properly), and the next diff --git a/lib/Pod/t/man.t b/lib/Pod/t/man.t index 3ad1f83..5d4d231 100644 --- a/lib/Pod/t/man.t +++ b/lib/Pod/t/man.t @@ -1,9 +1,9 @@ #!/usr/bin/perl -w -# $Id: man.t,v 1.10 2006-09-16 20:25:25 eagle Exp $ +# $Id: man.t,v 1.12 2007-11-29 01:35:54 eagle Exp $ # # man.t -- Additional specialized tests for Pod::Man. # -# Copyright 2002, 2003, 2004, 2006 by Russ Allbery +# Copyright 2002, 2003, 2004, 2006, 2007 by Russ Allbery # # This program is free software; you may redistribute it and/or modify it # under the same terms as Perl itself. @@ -17,7 +17,7 @@ BEGIN { } unshift (@INC, '../blib/lib'); $| = 1; - print "1..21\n"; + print "1..22\n"; } END { @@ -29,8 +29,6 @@ use Pod::Man; $loaded = 1; print "ok 1\n"; -my $have_encoding = eval { require PerlIO::encoding; 1; } && ! $@; - my $parser = Pod::Man->new or die "Cannot create parser\n"; my $n = 2; while () { @@ -38,12 +36,12 @@ while () { open (TMP, '> tmp.pod') or die "Cannot create tmp.pod: $!\n"; # We have a test in ISO 8859-1 encoding. Make sure that nothing strange - # happens if Perl thinks the world is Unicode. - binmode (\*TMP, ':encoding(iso-8859-1)') if $have_encoding; + # happens if Perl thinks the world is Unicode. Wrap this in eval so that + # older versions of Perl don't croak. + eval { binmode (\*TMP, ':encoding(iso-8859-1)') }; while () { last if $_ eq "###\n"; - no warnings 'utf8'; print TMP $_; } close TMP; @@ -359,8 +357,8 @@ Blorp C<' ### .SH "Newline C Quote Weirdness" .IX Header "Newline C Quote Weirdness" -Blorp \f(CW' -\&''\fR. Yes. +Blorp \f(CW\*(Aq +\&\*(Aq\*(Aq\fR. Yes. ### ### @@ -423,3 +421,13 @@ $-0.13 should have a real hyphen. Don't transform\ even-this\ hyphen. This \*(L"one's-fine!\*(R", as well. However, $\-0.13 should have a real hyphen. ### + +### +=head1 Quote escaping + +Don't escape `this' but do escape C<`this'> (and don't surround it in quotes). +### +.SH "Quote escaping" +.IX Header "Quote escaping" +Don't escape `this' but do escape \f(CW\`this\*(Aq\fR (and don't surround it in quotes). +### diff --git a/lib/Pod/t/text.t b/lib/Pod/t/text.t index cbe3782..b1995f2 100644 --- a/lib/Pod/t/text.t +++ b/lib/Pod/t/text.t @@ -1,9 +1,9 @@ #!/usr/bin/perl -w -# $Id: text.t,v 1.5 2006-01-28 22:31:50 eagle Exp $ +# $Id: text.t,v 1.6 2007-09-12 00:20:08 eagle Exp $ # # text.t -- Additional specialized tests for Pod::Text. # -# Copyright 2002, 2004, 2006 by Russ Allbery +# Copyright 2002, 2004, 2006, 2007 by Russ Allbery # # This program is free software; you may redistribute it and/or modify it # under the same terms as Perl itself. @@ -17,7 +17,7 @@ BEGIN { } unshift (@INC, '../blib/lib'); $| = 1; - print "1..3\n"; + print "1..4\n"; } END { @@ -25,6 +25,7 @@ END { } use Pod::Text; +use Pod::Simple; $loaded = 1; print "ok 1\n"; @@ -57,6 +58,8 @@ while () { } if ($output eq $expected) { print "ok $n\n"; + } elsif ($n == 4 && $Pod::Simple::VERSION < 3.06) { + print "ok $n # skip Pod::Simple S<> parsing bug\n"; } else { print "not ok $n\n"; print "Expected\n========\n$expected\nOutput\n======\n$output\n"; @@ -89,3 +92,13 @@ C<> WITH SPACES What does "this." end up looking like? ### + +### +=head1 Test of SEE + +This is some S< > whitespace. +### +Test of S<> + This is some whitespace. +### +==