avoid escaping & et al multiple times (variant of fix suggested by
Gurusamy Sarathy [Sun, 28 Feb 1999 18:49:08 +0000 (18:49 +0000)]
James Cromie <jcromie@fossil.uswc.uswest.com>

p4raw-id: //depot/perl@3031

lib/Pod/Html.pm

index 9245315..4fe7586 100644 (file)
@@ -1299,7 +1299,7 @@ WARN
 
 sub html_escape {
     my $rest = $_[0];
-    $rest   =~ s/&/&amp;/g;
+    $rest   =~ s/&(?!\w+;|#)/&amp;/g;  # XXX not bulletproof
     $rest   =~ s/</&lt;/g;
     $rest   =~ s/>/&gt;/g;
     $rest   =~ s/"/&quot;/g;