From: Abigail Date: Wed, 15 Jul 1998 03:47:56 +0000 (-0400) Subject: pod/pod2man.PL Fix use of < inside C<> X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c16f2413108912acc1226c4ccb6b19c51780a92f;p=p5sagit%2Fp5-mst-13.2.git pod/pod2man.PL Fix use of < inside C<> Message-Id: <19980715074756.21868.qmail@betelgeuse.wayne.fnx.com> p4raw-id: //depot/perl@1516 --- diff --git a/pod/pod2man.PL b/pod/pod2man.PL index 26c9764..8040bf5 100644 --- a/pod/pod2man.PL +++ b/pod/pod2man.PL @@ -673,6 +673,9 @@ $indent = 0; $begun = ""; +# Unrolling [^A-Z>]|[A-Z](?!<) gives: // MRE pp 165. +my $nonest = '(?:[^A-Z>]*(?:[A-Z](?!<)[^A-Z>]*)*)'; + while (<>) { if ($cutting) { next unless /^=/; @@ -742,7 +745,7 @@ while (<>) { # first hide the escapes in case we need to # intuit something and get it wrong due to fmting - 1 while s/([A-Z]<[^<>]*>)/noremap($1)/ge; + 1 while s/([A-Z]<$nonest>)/noremap($1)/ge; # func() is a reference to a perl function s{ @@ -799,13 +802,13 @@ while (<>) { while ($maxnest-- && /[A-Z]]*)>/font($1) . $2 . font('R')/eg; + s/([BI])<($nonest)>/font($1) . $2 . font('R')/eg; # files and filelike refs in italics - s/F<([^<>]*)>/I<$1>/g; + s/F<($nonest)>/I<$1>/g; # no break -- usually we want C<> for this - s/S<([^<>]*)>/nobreak($1)/eg; + s/S<($nonest)>/nobreak($1)/eg; # LREF: a la HREF L s:L<([^|>]+)\|[^>]+>:$1:g; @@ -859,7 +862,7 @@ while (<>) { s/Z<>/\\&/g; # comes last because not subject to reprocessing - s/C<([^<>]*)>/noremap("${CFont_embed}${1}\\fR")/eg; + s/C<($nonest)>/noremap("${CFont_embed}${1}\\fR")/eg; } if (s/^=//) {