Solstice::StripScripts::Parser - Custom HTML whitelist for use in web content formatting.


Solstice documentation Contained in the Solstice distribution.

Index


Code Index:

NAME

Top

Solstice::StripScripts::Parser - Custom HTML whitelist for use in web content formatting.

SYNOPSIS

Top

DESCRIPTION

Top

Superclass

Solstice::StripScripts, HTML::Parser.

Export

No symbols exported.

Methods

Modules Used

Solstice::StripScripts, HTML::Parser.

AUTHOR

Top

Catalyst Group, <catalyst@u.washington.edu>

VERSION

Top

$Revision: 3364 $

COPYRIGHT

Top


Solstice documentation Contained in the Solstice distribution.
package Solstice::StripScripts::Parser;

## no critic
#This code is constrained by being a subclass of a stripscripts class - we can't apply our styles to it

# $Id: Parser.pm 3364 2006-05-05 07:18:21Z mcrawfor $

use 5.006_000;
use strict;
use warnings;

use Solstice::StripScripts;

use HTML::Parser;

our @ISA = qw(Solstice::StripScripts HTML::Parser);
our ($VERSION) = ('$Revision: 3364 $' =~ /^\$Revision:\s*([\d.]*)/);


sub hss_init {
    my ($self, $cfg, @parser_options) = @_;

    $self->init(
        @parser_options,

        api_version      => 3,
        start_document_h => ['input_start_document', 'self'],
        start_h          => ['input_start',          'self,text'],
        end_h            => ['input_end',            'self,text'],
        text_h           => ['input_text',           'self,text'],
        default_h        => ['input_text',           'self,text'],
        declaration_h    => ['input_declaration',    'self,text'],
        comment_h        => ['input_comment',        'self,text'],
        process_h        => ['input_process',        'self,text'],
        end_document_h   => ['input_end_document',   'self'],

        # workaround for http://rt.cpan.org/NoAuth/Bug.html?id=3954
        ( $HTML::Parser::VERSION =~ /^3\.(29|30|31)$/
            ?  ( strict_comment => 1 )
            :  ()
        ),
    );

    # Custom whitelist for css class
    $self->{'_hssClass'} = $self->init_class_whitelist;
    
    $self->SUPER::hss_init($cfg);
}


1;
__END__