diff options
-rw-r--r-- | pod/pod2man.PL | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/pod/pod2man.PL b/pod/pod2man.PL index 26c9764101..8040bf5d63 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]</) { # can't do C font here - s/([BI])<([^<>]*)>/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<show this text|man/section> 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/^=//) { |