This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pod2html mangles C<&foo(42);>
authorHans Mulder <hansmu@xs4all.nl>
Sun, 15 Jun 1997 11:26:17 +0000 (23:26 +1200)
committerTim Bunce <Tim.Bunce@ig.co.uk>
Wed, 6 Aug 1997 12:00:00 +0000 (00:00 +1200)
Pod2html does not handle ampersands inside C<> sequences properly.
For example, C<&foo(42);> is translated to <CODE>&foo(42);</CODE>.
This is wrong: the "&" needs to be translated to "&amp;".

p5p-msgid: 199706250057.CAA10162@xs1.xs4all.nl

lib/Pod/Html.pm

index 8245334..4e72f3e 100644 (file)
@@ -1427,7 +1427,7 @@ sub process_C {
        $s1 =~ s,(perl\w+/(\S+)\.html)#item_\2\b,$1,; 
        confess "s1 has space: $s1" if $s1 =~ /HREF="[^"]*\s[^"]*"/;
     } else {
-       $s1 = "<CODE>$str</CODE>";
+       $s1 = "<CODE>" . html_escape($str) . "</CODE>";
        # warn "$0: $podfile: cannot resolve C<$str> in paragraph $paragraph\n" if $verbose
     }