File Coverage

blib/lib/Pod/Tree/HTML/PerlTop.pm
Criterion Covered Total %
statement 11 26 42.3
branch 0 2 0.0
condition n/a
subroutine 4 6 66.6
pod 0 1 0.0
total 15 35 42.8


line stmt bran cond sub pod time code
1             package Pod::Tree::HTML::PerlTop;
2 2     2   8044960 use 5.006;
  2         10  
3 2     2   24 use strict;
  2         11  
  2         79  
4 2     2   20 use warnings;
  2         4  
  2         140  
5              
6 2     2   20 use base qw(Pod::Tree::HTML);
  2         11  
  2         1110  
7              
8             our $VERSION = '1.31';
9              
10             sub set_links {
11 0     0 0   my ( $html, $links ) = @_;
12 0           $html->{links} = $links;
13             }
14              
15             sub _emit_verbatim {
16 0     0     my ( $html, $node ) = @_;
17 0           my $stream = $html->{stream};
18 0           my $links = $html->{links};
19 0           my $text = $node->get_text;
20              
21 0           $text =~ s( \n\n$ )()x;
22 0           my @words = split m/(\s+)/, $text;
23              
24 0           $stream->PRE;
25              
26 0           for my $word (@words) {
27 0 0         if ( $links->{$word} ) {
28 0           my $link = $links->{$word};
29 0           $stream->A( HREF => "$link.html" )->text($word)->_A;
30             }
31             else {
32 0           $stream->text($word);
33             }
34             }
35              
36 0           $stream->_PRE;
37             }
38              
39             1;