Bug#836831: raw nroff appears on man page

Russ Allbery rra at debian.org
Tue Sep 6 16:02:33 UTC 2016


gregor herrmann <gregoa at debian.org> writes:

> Interesting.

> lib/XML/LibXML/Element.pod has

> This function tests if the named attribute is set for the node. If the
> attribute is specified, TRUE (1) will be returned, otherwise the return value
> is FALSE (0).

> `perldoc lib/XML/LibXML/Element.pod' renders this as

>         This function tests if the named attribute is set for the node. If the
>         attribute is specified, TRUE (1) will be returned, otherwise the
>         return value is FALSE (0).

> `pod2man lib/XML/LibXML/Element.pod | man -l -' shows
>            This function tests if the named attribute is set for the node. If the attribute is specified, TRUE \fIs0(1) will be returned,
>            otherwise the return value is FALSE \fIs0(0).

Bug in pod2man.  This is the fix, although there's still something too
fragile about the auto-detection of man page references that for some
reason is still picking up a string that contains a space.  I haven't
figured out that part yet.

--- a/lib/Pod/Man.pm
+++ b/lib/Pod/Man.pm
@@ -514,9 +514,9 @@ sub guesswork {
     # entire warranty disclaimers in man page output into small caps.
     if ($$self{MAGIC_SMALLCAPS}) {
         s{
-            ( ^ | [\s\(\"\'\`\[\{<>] | \\[ ]  )                     # (1)
-            ( [A-Z] [A-Z] (?: [/A-Z+:\d_\$&] | \\- | [.,\"\s] )* )  # (2)
-            (?= [\s>\}\]\(\)\'\".?!,;] | \\*\(-- | \\[ ] | $ )      # (3)
+            ( ^ | [\s\(\"\'\`\[\{<>] | \\[ ]  )                       # (1)
+            ( [A-Z] [A-Z] (?: \s? [/A-Z+:\d_\$&] | \\- | [.,\"] )* )  # (2)
+            (?= [\s>\}\]\(\)\'\".?!,;] | \\*\(-- | \\[ ] | $ )        # (3)
         } {
             $1 . '\s-1' . $2 . '\s0'
         }egx;

(Yes, these regexes are horrible.)

-- 
Russ Allbery (rra at debian.org)               <http://www.eyrie.org/~eagle/>



More information about the pkg-perl-maintainers mailing list