File Coverage

blib/lib/Pod/Simple/TextContent.pm
Criterion Covered Total %
statement 28 28 100.0
branch 4 4 100.0
condition 1 2 50.0
subroutine 8 8 100.0
pod 1 1 100.0
total 42 43 97.6


line stmt bran cond sub pod time code
1              
2              
3             require 5;
4             package Pod::Simple::TextContent;
5 2     2   6575 use strict;
  2         11  
  2         56  
6 2     2   11 use Carp ();
  2         3  
  2         40  
7 2     2   608 use Pod::Simple ();
  2         5  
  2         49  
8 2     2   11 use vars qw( @ISA $VERSION );
  2         4  
  2         695  
9             $VERSION = '3.43';
10             @ISA = ('Pod::Simple');
11              
12             sub new {
13 5     5 1 13868 my $self = shift;
14 5         41 my $new = $self->SUPER::new(@_);
15 5   50     37 $new->{'output_fh'} ||= *STDOUT{IO};
16 5         26 $new->nix_X_codes(1);
17 5         16 return $new;
18             }
19              
20             #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21              
22             sub _handle_element_start {
23 1316 100   1316   3686 print {$_[0]{'output_fh'}} "\n" unless $_[1] =~ m/^[A-Z]$/s;
  765         3103  
24 1316         2388 return;
25             }
26              
27             sub _handle_text {
28 1774     1774   4220 $_[1] =~ s/$Pod::Simple::shy//g;
29 1774         2681 $_[1] =~ s/$Pod::Simple::nbsp/ /g;
30 1774         2287 print {$_[0]{'output_fh'}} $_[1];
  1774         4153  
31 1774         4330 return;
32             }
33              
34             sub _handle_element_end {
35 1316 100   1316   3538 print {$_[0]{'output_fh'}} "\n" unless $_[1] =~ m/^[A-Z]$/s;
  765         1975  
36 1316         2199 return;
37             }
38              
39             #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
40             1;
41              
42              
43             __END__