File Coverage

blib/lib/Data/FormValidator/Filters/HTMLScrubber.pm
Criterion Covered Total %
statement 16 22 72.7
branch n/a
condition n/a
subroutine 4 7 57.1
pod 1 1 100.0
total 21 30 70.0


line stmt bran cond sub pod time code
1             package Data::FormValidator::Filters::HTMLScrubber;
2              
3 1     1   33054 use strict;
  1         4  
  1         47  
4 1     1   5 use vars qw( $VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS );
  1         2  
  1         170  
5 1     1   1065 use HTML::Scrubber;
  1         44055  
  1         129  
6              
7             BEGIN {
8 1     1   16 require Exporter;
9 1         4 $VERSION = '0.02';
10 1         40 @ISA = qw( Exporter );
11 1         2 @EXPORT = qw();
12 1         5 %EXPORT_TAGS = (
13             'all' => [ qw( html_scrub ) ]
14             );
15 1         2 @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
  1         161  
16             }
17              
18             sub html_scrub {
19 0     0 1   my %args = @_;
20 0     0     return sub { return _html_scrub( shift, %args ) };
  0            
21             }
22              
23             sub _html_scrub {
24 0     0     my ($value,%args) = @_;
25 0           my $scrubber = HTML::Scrubber->new(
26             default => $args{default},
27             allow => $args{allow},
28             deny => $args{deny},
29             rules => $args{rules},
30             process => $args{process},
31             comment => $args{comment}
32             );
33 0           return $scrubber->scrub($value);
34             }
35              
36             1;
37             __END__