Subject: | No Encoding of C<> in XHTML |
Date: | Thu, 7 May 2009 13:00:24 -0700 |
To: | bug-pod-simple [...] rt.cpan.org |
From: | "David E. Wheeler" <dwheeler [...] cpan.org> |
Howdy,
Here's a patch that fixes Pod::Simple::XHTML so that it properly
encodes entities for <code></code> spans.
Index: XHTML.pm
===================================================================
--- XHTML.pm (revision 356)
+++ XHTML.pm (working copy)
@@ -328,8 +328,8 @@
sub start_B { $_[0]{'scratch'} .= '<b>' }
sub end_B { $_[0]{'scratch'} .= '</b>' }
-sub start_C { $_[0]{'scratch'} .= '<code>' }
-sub end_C { $_[0]{'scratch'} .= '</code>' }
+sub start_C { $_[0]{'scratch'} .= '<code>'; $_[0]{'in_verbatim'} = 1; }
+sub end_C { $_[0]{'scratch'} .= '</code>'; $_[0]{'in_verbatim'} =
0; }
sub start_E { $_[0]{'scratch'} .= '&' }
sub end_E { $_[0]{'scratch'} .= ';' }
Best,
David