lib/Pod/Tree/HTML/PerlTop.pm untested

filter: Statementstmt 0.0% 0 / 28 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 38 CC 2 SCAR 11.5
CC
2
Cov
0%
_emit_verbatim
6.0
set_links
2.0
BEGIN
2.0
CRAP 3.1
1 package Pod::Tree::HTML::PerlTop;
2 use 5.006;
3 use strict;
4 use warnings;
5  
6 use base qw(Pod::Tree::HTML);
7  
8 our $VERSION = '1.31';
9  
10 sub set_links {
11 my ( $html, $links ) = @_;
12 $html->{links} = $links;
13 }
14  
15 sub _emit_verbatim {
16 my ( $html, $node ) = @_;
17 my $stream = $html->{stream};
18 my $links = $html->{links};
19 my $text = $node->get_text;
20  
21 $text =~ s( \n\n$ )()x;
22 my @words = split m/(\s+)/, $text;
23  
24 $stream->PRE;
25  
26 for my $word (@words) {
27 if ( $links->{$word} ) {
28 my $link = $links->{$word};
29 $stream->A( HREF => "$link.html" )->text($word)->_A;
30 }
31 else {
32 $stream->text($word);
33 }
34 }
35  
36 $stream->_PRE;
37 }
38  
39 1;