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