Skip to content
Browse files

Added HTML entity encoding to index elements.

  • Loading branch information...
1 parent f0834c7 commit 1eaeb79173bf8c7cad2e677c5be6b75f8f84cc02 @chromatic committed Mar 23, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/Pod/PseudoPod/DOM/Index.pm
View
7 lib/Pod/PseudoPod/DOM/Index.pm
@@ -65,6 +65,7 @@ use strict;
use warnings;
use Moose;
+use HTML::Entities;
has 'key', is => 'ro', required => 1;
has 'contents', is => 'ro', default => sub { {} };
@@ -116,7 +117,7 @@ sub add_entry
sub emit
{
my $self = shift;
- my $key = $self->key;
+ my $key = encode_entities( $self->key );
return qq|$key\n| . $self->emit_contents;
}
@@ -162,6 +163,7 @@ use strict;
use warnings;
use Moose;
+use HTML::Entities;
has 'key', is => 'ro', required => 1;
has 'locations', is => 'ro', default => sub { [] };
@@ -170,7 +172,8 @@ sub emit
{
my $self = shift;
- return $self->key . ' ' . join ' ', map { $_->emit } @{ $self->locations };
+ return encode_entities( $self->key ) . ' '
+ . join ' ', map { $_->emit } @{ $self->locations };
}
sub add_location

0 comments on commit 1eaeb79

Please sign in to comment.
Something went wrong with that request. Please try again.