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