HTML-EscapeEvil

 view release on metacpan or  search on metacpan

EscapeEvil.pm  view on Meta::CPAN


sub comment {

    my ( $self, $comment ) = @_;
    $comment = "<!--$comment-->";
    $self->output( ( $self->{allow_comment} ) ? $comment : &_escape($comment) );
}

sub text {

    my ( $self, $text, $is_cdata ) = @_;
    $text = &_escape($text);
    $text = &_unescape_entities($text) if $self->{allow_entity_reference};
    $text = &_unescape($text)
      if $is_cdata
      && $self->{_current_tag} eq "script"
      && $self->{allow_script};
    $text = &_unescape($text)
      if $is_cdata && $self->{_current_tag} eq "style" && $self->{allow_style};
    $self->SUPER::text( $text, $is_cdata );
}

sub output {

    my ( $self, $content ) = @_;
    push @{ $self->{_content} }, $content;
}

1;



( run in 0.738 second using v1.01-cache-2.11-cpan-454fe037f31 )