blib/lib/DTL/Fast/Filter/Truncatewordshtml.pm

filter: Statementstmt 100% 24 / 24 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 96.8% 31 / 32 SCAR 11.0
CC
3
Cov
100%
filter
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« blib/lib/DTL/Fast/Filter/Truncatecharshtml.pm ↑ Summary blib/lib/DTL/Fast/Tag/Load.pm »
1 package DTL::Fast::Filter::Truncatewordshtml;
2 2 ▶use strict; use utf8; use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use parent 'DTL::Fast::Filter::Truncatewords';
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 2 $DTL::Fast::FILTER_HANDLERS{'truncatewords_html'} = __PACKAGE__;
6  
7 #@Override
8 sub filter
9 {
10 2 ▶ my $self = shift; # self
Subroutine filter: called CC=3 SCAR=11.0
Pod undocumented
11 2 my $filter_manager = shift; # filter_manager
12 2 my $value = shift;
13 2 my $context = shift;
14
15 2 my @splitted = split /(<[^>]+?>)/s, $value;
16  
17 2 foreach my $value (@splitted)
18 {
19 6 ▶ if( $value !~ /^(<[^>]+?>|\s*)$/gs )
Branch: 1 branch
BranchTrueFalseTotal
unless ($value =~ /^(<[^>]+?>|\s*)$/gs) 2 4 6
20 {
21 2 $value = $self->SUPER::filter($filter_manager, $value, $context);
22 2 last;
23 }
24 }
25
26 2 return join '', @splitted;
27 }
28  
29 2 1;
« blib/lib/DTL/Fast/Filter/Truncatecharshtml.pm ↑ Summary blib/lib/DTL/Fast/Tag/Load.pm »