From: Gurusamy Sarathy <gsar@cpan.org>
Date: Sun, 28 Feb 1999 18:49:08 +0000 (+0000)
Subject: avoid escaping &amp; et al multiple times (variant of fix suggested by
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a3c03ba209b02672dbbaf6126566a46706d2337b;p=p5sagit%2Fp5-mst-13.2.git

avoid escaping &amp; et al multiple times (variant of fix suggested by
James Cromie <jcromie@fossil.uswc.uswest.com>

p4raw-id: //depot/perl@3031
---

diff --git a/lib/Pod/Html.pm b/lib/Pod/Html.pm
index 9245315..4fe7586 100644
--- a/lib/Pod/Html.pm
+++ b/lib/Pod/Html.pm
@@ -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;