HTML::EscapeEvil::AllowAll - Escape tag.but all tag allow


HTML-EscapeEvil-AllowAll documentation Contained in the HTML-EscapeEvil-AllowAll distribution.

Index


Code Index:

NAME

Top

HTML::EscapeEvil::AllowAll - Escape tag.but all tag allow

VERSION

Top

0.05

SYNPSIS

Top

    use HTML::EscapeEvil::AllowAll;
    my $escapeallow = HTML::EscapeEvil::AllowAll->new;
    print "script is " , ($escapeallow->allow_script) ? "allow" : "not allow";
    print "style is " , ($escapeallow->allow_style) ? "allow" : "not allow";
    $escapeallow->clear;

DESCRIPTION

Top

Only tag where it wants to escape is specified with deny_tags method etc.

and it uses it because it all enters the state of permission.

METHOD

Top

new

Create HTML::EscapeEvil::AllowAll instance.

allow_all

All tags allow.

Example :

  $escapeallow->allow_all;

_to_flat_array

Private method.

_init

Private method.

SEE ALSO

Top

HTML::EscapeEvil

AUTHOR

Top

Akira Horimoto <kurt0027@gmail.com>

COPYRIGHT

Top


HTML-EscapeEvil-AllowAll documentation Contained in the HTML-EscapeEvil-AllowAll distribution.
package HTML::EscapeEvil::AllowAll;

use strict;
use base qw(HTML::EscapeEvil);

our $VERSION = 0.05;

sub new {

    my $class = shift;
    my $self  = $class->SUPER::new;
    bless $self, ref $class || $class;
    $self->{_tag_map} = [];
    $self->_init;
    $self->allow_all;
    $self;
}

sub allow_all {

    my $self = shift;
    $self->allow_comment(1);
    $self->allow_declaration(1);
    $self->allow_process(1);
    $self->allow_entity_reference(1);
    $self->collection_process(1);

    $self->add_allow_tags( $self->_to_flat_array );
}

sub _to_flat_array {

    map { @{$_} } @{shift->{_tag_map}};
}

sub _init {

    my $self = shift;
    $self->{_tag_map} = [
                         [ "a", "abbr", "acronym", "address", "area" ],
                         [ "b", "base", "basefont", "bdo", "big", "blockquote", "body", "br", "button" ],
                         [ "caption", "cite", "code", "col", "colgroup" ],
                         [ "dd", "del", "dfn", "div", "dl", "dt" ],
                         [ "em", "embed" ],
                         [ "fieldset", "frameset", "font", "form" ],
                         [ "h1", "h2", "h3", "h4", "h5", "h6", "head", "hr", "html" ],
                         [ "i", "iframe", "img", "input", "ins" ],
                         [ "kbd" ],
                         [ "label", "legend", "li", "link" ],
                         [ "map", "meta" ],
                         [ "nobr", "noscript" ],
                         [ "object", "ol", "optgroup", "option" ],
                         [ "p", "param", "pre" ],
                         [ "q" ],
                         [ "rb", "rbc", "rp", "rt", "rtc", "ruby" ],
                         [ "s", "samp", "script", "select", "small", "span", "strong", "strike", "style", "sub", "sup" ],
                         [ "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "title", "tr", "tt" ],
                         [ "u", "ul" ],
                         [ "var" ]
                        ];
}

1;

__END__