File Coverage

blib/lib/Pod/Simple/Role/XHTML/WithAccurateTargets.pm
Criterion Covered Total %
statement 18 18 100.0
branch 2 2 100.0
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 24 25 96.0


line stmt bran cond sub pod time code
1             package Pod::Simple::Role::XHTML::WithAccurateTargets;
2 2     2   554965 use Moo::Role;
  2         5  
  2         15  
3              
4             our $VERSION = '0.004000';
5             $VERSION =~ tr/_//d;
6              
7 2     2   1155 use Pod::Simple::XHTML ();
  2         5  
  2         65  
8              
9 2     2   743 use namespace::clean;
  2         23882  
  2         15  
10              
11             sub idify {
12 24     24 0 10585 my ( $self, $t, $not_unique ) = @_;
13              
14 24         125 $t =~ s/^\s+//;
15 24         125 $t =~ s/\s+$//;
16 24         121 $t =~ s/[\s-]+/-/g;
17              
18 24 100       130 return $t
19             if $not_unique;
20              
21 14         31 my $ids = $self->{ids};
22 14         35 my $i = '';
23 14         72 $i++ while $ids->{"$t$i"}++;
24 14         70 return "$t$i";
25             }
26              
27             with 'Pod::Simple::Role::XHTML::RepairLinkEncoding'
28             if !defined &Pod::Simple::XHTML::decode_entities;
29              
30             1;
31             __END__