Browse files

Improved HTML suppression in index anchors.

  • Loading branch information...
1 parent a1df6dd commit 7c455a44ef803e3a5fea0929dc76b5e9645aee1c @chromatic committed Mar 23, 2012
Showing with 10 additions and 21 deletions.
  1. +6 −21 lib/Pod/PseudoPod/DOM/Role/XHTML.pm
  2. +3 −0 t/html/escapes.t
  3. +1 −0 t/test_file.pod
View
27 lib/Pod/PseudoPod/DOM/Role/XHTML.pm
@@ -325,9 +325,12 @@ sub emit_verbatim
. "</code></pre>\n\n";
}
-sub emit_italics { shift->emit_tagged_kids( 'em', @_ ) }
-sub emit_code { shift->emit_tagged_kids( 'code', @_ ) }
-sub emit_bold { shift->emit_tagged_kids( 'strong', @_ ) }
+sub emit_italics { shift->emit_tagged_kids( 'em', @_ ) }
+sub emit_code { shift->emit_tagged_kids( 'code', @_ ) }
+sub emit_bold { shift->emit_tagged_kids( 'strong', @_ ) }
+sub emit_superscript { shift->emit_tagged_kids( 'sup', @_ ) }
+sub emit_subscript { shift->emit_tagged_kids( 'sub', @_ ) }
+sub emit_file { shift->emit_tagged_kids( 'em', @_ ) }
sub emit_tagged_kids
{
@@ -361,24 +364,6 @@ sub emit_link
return qq|<a href="$file#$frag">$text</a>|;
}
-sub emit_superscript
-{
- my $self = shift;
- return "<sup>" . $self->emit_kids . "</sup>";
-}
-
-sub emit_subscript
-{
- my $self = shift;
- return "<sub>" . $self->emit_kids . "</sub>";
-}
-
-sub emit_file
-{
- my $self = shift;
- return "<em>" . $self->emit_kids . "</em>";
-}
-
use constant { BEFORE => 0, AFTER => 1 };
my %block_items =
View
3 t/html/escapes.t
@@ -86,6 +86,9 @@ like_string $result, qr/<a name="&lt;=&gt;;numericcomparisonoperator1">/,
like_string $result, qr/<a name="sigils;&amp;1">/,
'... in index anchors as well';
+like_string $result, qr/<a name="\.tfiles1">/,
+ '... and should suppress HTML tags in index anchors';
+
like_string $result, qr/<li>\$BANG BANG\$<p>/,
'escapes work inside items first line';
View
1 t/test_file.pod
@@ -83,6 +83,7 @@ be single quotes, not fancy curly apostrophes.
X<Special formatting>
X<sigils; &>
+X<F<.t> files>
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

0 comments on commit 7c455a4

Please sign in to comment.