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