Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improved HTML escaping in index anchors.

  • Loading branch information...
commit a1df6dd6e9d3bda58d4594ece83611204b0666f5 1 parent 8df68b9
@chromatic authored
View
3  lib/Pod/PseudoPod/DOM/Role/XHTML.pm
@@ -246,8 +246,7 @@ sub encode_index_anchor
$text =~ s/^\*//;
$text =~ s/[\s"]//g;
- $text =~ s/</&lt;/g;
- $text =~ s/>/&gt;/g;
+ $text = encode_entities($text);
return $text;
}
View
3  t/html/escapes.t
@@ -83,6 +83,9 @@ like_string $result, qr/<a name="codeanditalicstext1">/,
like_string $result, qr/<a name="&lt;=&gt;;numericcomparisonoperator1">/,
'... and should escape <> symbols';
+like_string $result, qr/<a name="sigils;&amp;1">/,
+ '... in index anchors as well';
+
like_string $result, qr/<li>\$BANG BANG\$<p>/,
'escapes work inside items first line';
View
1  t/test_file.pod
@@ -82,6 +82,7 @@ behavior (C<$some_variable-->) should be fine too. C<'single quotes'> need to
be single quotes, not fancy curly apostrophes.
X<Special formatting>
+X<sigils; &>
Index entries are more fun, as more special characters must be escaped, with a
quote sign. E.g. X<negation ! operator>, X<array @ sigil>, X<the pipe |> and
Please sign in to comment.
Something went wrong with that request. Please try again.