Skip Menu |

This queue is for tickets about the podlators CPAN distribution.

Report information
The Basics
Id: 35822
Status: resolved
Priority: 0/
Queue: podlators

People
Owner: Nobody in particular
Requestors: ntyni [...] iki.fi
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.0.6
Fixed in: 2.1.0



Subject: `\-' is not allowed in an escape name
As reported in <http://bugs.debian.org/480565>, pod2man seems to overescape dashes when dealing with non-ascii characters. % echo -e '=pod\n\nE<eth>' | pod2man | tail -1 \&\*(d\- This should apparently be \d- instead. Thanks for your work on the Pod::* modules, -- Niko Tyni ntyni@debian.org
CC: 480565 [...] bugs.debian.org
Subject: Re: [rt.cpan.org #35822] `\-' is not allowed in an escape name
Date: Mon, 12 May 2008 15:44:57 -0700
To: bug-podlators [...] rt.cpan.org
From: Russ Allbery <rra [...] stanford.edu>
"ntyni@iki.fi via RT" <bug-podlators@rt.cpan.org> writes: Show quoted text
> As reported in <http://bugs.debian.org/480565>, pod2man seems to > overescape dashes when dealing with non-ascii characters. > > % echo -e '=pod\n\nE<eth>' | pod2man | tail -1 > \&\*(d\- > > This should apparently be \d- instead. > > Thanks for your work on the Pod::* modules,
Indeed, thanks. Here's the fix, which will be in the next release. Index: lib/Pod/Man.pm =================================================================== RCS file: /home/eagle/cvs/pod/lib/Pod/Man.pm,v retrieving revision 2.16 diff -u -p -r2.16 Man.pm --- lib/Pod/Man.pm 29 Nov 2007 01:35:53 -0000 2.16 +++ lib/Pod/Man.pm 12 May 2008 22:44:01 -0000 @@ -348,23 +348,22 @@ sub format_text { my $convert = $$options{convert}; my $literal = $$options{literal}; - # Normally we do character translation, but we won't even do that in - # <Data> blocks. - if ($convert) { - if (ASCII) { - $text =~ s/(\\|[^\x00-\x7F])/$ESCAPES{ord ($1)} || "X"/eg; - } else { - $text =~ s/(\\)/$ESCAPES{ord ($1)} || "X"/eg; - } - } - # Cleanup just tidies up a few things, telling *roff that the hyphens are - # hard and putting a bit of space between consecutive underscores. + # hard, putting a bit of space between consecutive underscores, and + # escaping backslashes. Be careful not to mangle our character + # translations by doing this before processing character translation. if ($cleanup) { + $text =~ s/\\/\\e/g; $text =~ s/-/\\-/g; $text =~ s/_(?=_)/_\\|/g; } + # Normally we do character translation, but we won't even do that in + # <Data> blocks. + if ($convert && ASCII) { + $text =~ s/([^\x00-\x7F])/$ESCAPES{ord ($1)} || "X"/eg; + } + # Ensure that *roff doesn't convert literal quotes to UTF-8 single quotes, # but don't mess up our accept escapes. if ($literal) { @@ -1294,9 +1293,6 @@ sub parse_from_filehandle { "o\\*/" , "u\\*`", "u\\*'", "u\\*^", "u\\*:", "y\\*'", "\\*(th", "y\\*:", ) if ASCII; -# Make sure that at least this works even outside of ASCII. -$ESCAPES{ord("\\")} = "\\e"; - ############################################################################## # Premable ############################################################################## -- Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
This should now be fixed in podlators 2.1.0.