line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DTL::Fast::Filter::Truncatecharshtml; |
2
|
2
|
|
|
2
|
|
844
|
use strict; use utf8; use warnings FATAL => 'all'; |
|
2
|
|
|
2
|
|
3
|
|
|
2
|
|
|
2
|
|
44
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
34
|
|
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
67
|
|
3
|
2
|
|
|
2
|
|
7
|
use parent 'DTL::Fast::Filter::Truncatechars'; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
10
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
$DTL::Fast::FILTER_HANDLERS{'truncatechars_html'} = __PACKAGE__; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
#@Override |
8
|
|
|
|
|
|
|
sub filter |
9
|
|
|
|
|
|
|
{ |
10
|
6
|
|
|
6
|
0
|
5
|
my $self = shift; # self |
11
|
6
|
|
|
|
|
6
|
my $filter_manager = shift; # filter_manager |
12
|
6
|
|
|
|
|
3
|
my $value = shift; |
13
|
6
|
|
|
|
|
5
|
my $context = shift; |
14
|
|
|
|
|
|
|
|
15
|
6
|
|
|
|
|
32
|
my @splitted = split /(<[^>]+?>)/s, $value; |
16
|
|
|
|
|
|
|
|
17
|
6
|
|
|
|
|
8
|
foreach my $value (@splitted) |
18
|
|
|
|
|
|
|
{ |
19
|
16
|
100
|
|
|
|
58
|
if( $value !~ /^(<[^>]+?>|\s*)$/gs ) |
20
|
|
|
|
|
|
|
{ |
21
|
6
|
|
|
|
|
16
|
$value = $self->SUPER::filter($filter_manager, $value, $context); |
22
|
6
|
|
|
|
|
9
|
last; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
6
|
|
|
|
|
24
|
return join '', @splitted; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |