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   5366 use strict;
  2         9  
  2         53  
6 2     2   10 use Carp ();
  2         4  
  2         25  
7 2     2   452 use Pod::Simple ();
  2         5  
  2         45  
8 2     2   10 use vars qw( @ISA $VERSION );
  2         4  
  2         660  
9             $VERSION = '3.42';
10             @ISA = ('Pod::Simple');
11              
12             sub new {
13 5     5 1 10731 my $self = shift;
14 5         33 my $new = $self->SUPER::new(@_);
15 5   50     30 $new->{'output_fh'} ||= *STDOUT{IO};
16 5         18 $new->nix_X_codes(1);
17 5         12 return $new;
18             }
19              
20             #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21              
22             sub _handle_element_start {
23 1316 100   1316   3289 print {$_[0]{'output_fh'}} "\n" unless $_[1] =~ m/^[A-Z]$/s;
  765         2304  
24 1316         1811 return;
25             }
26              
27             sub _handle_text {
28 1774     1774   3289 $_[1] =~ s/$Pod::Simple::shy//g;
29 1774         2104 $_[1] =~ s/$Pod::Simple::nbsp/ /g;
30 1774         1767 print {$_[0]{'output_fh'}} $_[1];
  1774         3442  
31 1774         3437 return;
32             }
33              
34             sub _handle_element_end {
35 1316 100   1316   2621 print {$_[0]{'output_fh'}} "\n" unless $_[1] =~ m/^[A-Z]$/s;
  765         1501  
36 1316         1785 return;
37             }
38              
39             #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
40             1;
41              
42              
43             __END__