line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Plugin::StripScripts; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
40036
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
88
|
|
4
|
2
|
|
|
2
|
|
2161
|
use HTML::StripScripts::Parser; |
|
2
|
|
|
|
|
28357
|
|
|
2
|
|
|
|
|
92
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
24
|
use base qw (Template::Plugin::Filter); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
1657
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = 0.02; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub init { |
11
|
2
|
|
|
2
|
0
|
6324
|
my $self = shift; |
12
|
2
|
|
|
|
|
15
|
$self->{_DYNAMIC} = 1; |
13
|
2
|
|
50
|
|
|
29
|
$self->install_filter($self->{_ARGS}->[0] || 'stripscripts'); |
14
|
2
|
|
|
|
|
107
|
$self; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub filter { |
18
|
2
|
|
|
2
|
0
|
214
|
my ($self, $text, $args, $config) = @_; |
19
|
2
|
|
|
|
|
8
|
my $parser_options = delete $config->{ParserOptions}; |
20
|
2
|
50
|
|
|
|
30
|
my $hss = HTML::StripScripts::Parser->new( |
21
|
|
|
|
|
|
|
$config, |
22
|
|
|
|
|
|
|
ref $parser_options eq 'HASH' ? %$parser_options : undef, |
23
|
|
|
|
|
|
|
); |
24
|
2
|
|
|
|
|
527
|
return $hss->filter_html($text); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
__END__ |