line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
require 5; |
3
|
|
|
|
|
|
|
package Pod::Simple::Text; |
4
|
6
|
|
|
6
|
|
15759
|
use strict; |
|
6
|
|
|
|
|
26
|
|
|
6
|
|
|
|
|
163
|
|
5
|
6
|
|
|
6
|
|
54
|
use Carp (); |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
98
|
|
6
|
6
|
|
|
6
|
|
1527
|
use Pod::Simple::Methody (); |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
117
|
|
7
|
6
|
|
|
6
|
|
31
|
use Pod::Simple (); |
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
115
|
|
8
|
6
|
|
|
6
|
|
26
|
use vars qw( @ISA $VERSION $FREAKYMODE); |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
640
|
|
9
|
|
|
|
|
|
|
$VERSION = '3.42'; |
10
|
|
|
|
|
|
|
@ISA = ('Pod::Simple::Methody'); |
11
|
|
|
|
|
|
|
BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG) |
12
|
|
|
|
|
|
|
? \&Pod::Simple::DEBUG |
13
|
|
|
|
|
|
|
: sub() {0} |
14
|
6
|
50
|
|
6
|
|
157
|
} |
15
|
|
|
|
|
|
|
|
16
|
6
|
|
|
6
|
|
2337
|
use Text::Wrap 98.112902 (); |
|
6
|
|
|
|
|
12029
|
|
|
6
|
|
|
|
|
6102
|
|
17
|
|
|
|
|
|
|
$Text::Wrap::huge = 'overflow'; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new { |
22
|
33
|
|
|
33
|
1
|
15741
|
my $self = shift; |
23
|
33
|
|
|
|
|
155
|
my $new = $self->SUPER::new(@_); |
24
|
33
|
|
50
|
|
|
196
|
$new->{'output_fh'} ||= *STDOUT{IO}; |
25
|
33
|
|
|
|
|
128
|
$new->accept_target_as_text(qw( text plaintext plain )); |
26
|
33
|
|
|
|
|
115
|
$new->nix_X_codes(1); |
27
|
33
|
|
|
|
|
100
|
$new->nbsp_for_S(1); |
28
|
33
|
|
|
|
|
94
|
$new->{'Thispara'} = ''; |
29
|
33
|
|
|
|
|
70
|
$new->{'Indent'} = 0; |
30
|
33
|
|
|
|
|
58
|
$new->{'Indentstring'} = ' '; |
31
|
33
|
|
|
|
|
97
|
return $new; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
35
|
|
|
|
|
|
|
|
36
|
3588
|
|
|
3588
|
0
|
8024
|
sub handle_text { $_[0]{'Thispara'} .= $_[1] } |
37
|
|
|
|
|
|
|
|
38
|
807
|
|
|
807
|
0
|
1504
|
sub start_Para { $_[0]{'Thispara'} = '' } |
39
|
45
|
|
|
45
|
0
|
113
|
sub start_head1 { $_[0]{'Thispara'} = '' } |
40
|
98
|
|
|
98
|
0
|
281
|
sub start_head2 { $_[0]{'Thispara'} = '' } |
41
|
0
|
|
|
0
|
0
|
0
|
sub start_head3 { $_[0]{'Thispara'} = '' } |
42
|
0
|
|
|
0
|
0
|
0
|
sub start_head4 { $_[0]{'Thispara'} = '' } |
43
|
|
|
|
|
|
|
|
44
|
146
|
|
|
146
|
0
|
290
|
sub start_Verbatim { $_[0]{'Thispara'} = '' } |
45
|
58
|
50
|
|
58
|
0
|
143
|
sub start_item_bullet { $_[0]{'Thispara'} = $FREAKYMODE ? '' : '* ' } |
46
|
0
|
0
|
|
0
|
0
|
0
|
sub start_item_number { $_[0]{'Thispara'} = $FREAKYMODE ? '' : "$_[1]{'number'}. " } |
47
|
365
|
|
|
365
|
0
|
694
|
sub start_item_text { $_[0]{'Thispara'} = '' } |
48
|
|
|
|
|
|
|
|
49
|
12
|
|
|
12
|
0
|
21
|
sub start_over_bullet { ++$_[0]{'Indent'} } |
50
|
0
|
|
|
0
|
0
|
0
|
sub start_over_number { ++$_[0]{'Indent'} } |
51
|
27
|
|
|
27
|
0
|
56
|
sub start_over_text { ++$_[0]{'Indent'} } |
52
|
0
|
|
|
0
|
0
|
0
|
sub start_over_block { ++$_[0]{'Indent'} } |
53
|
|
|
|
|
|
|
|
54
|
12
|
|
|
12
|
0
|
71
|
sub end_over_bullet { --$_[0]{'Indent'} } |
55
|
0
|
|
|
0
|
0
|
0
|
sub end_over_number { --$_[0]{'Indent'} } |
56
|
27
|
|
|
27
|
0
|
161
|
sub end_over_text { --$_[0]{'Indent'} } |
57
|
0
|
|
|
0
|
0
|
0
|
sub end_over_block { --$_[0]{'Indent'} } |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
# . . . . . Now the actual formatters: |
61
|
|
|
|
|
|
|
|
62
|
45
|
|
|
45
|
0
|
118
|
sub end_head1 { $_[0]->emit_par(-4) } |
63
|
98
|
|
|
98
|
0
|
218
|
sub end_head2 { $_[0]->emit_par(-3) } |
64
|
0
|
|
|
0
|
0
|
0
|
sub end_head3 { $_[0]->emit_par(-2) } |
65
|
0
|
|
|
0
|
0
|
0
|
sub end_head4 { $_[0]->emit_par(-1) } |
66
|
807
|
|
|
807
|
0
|
1521
|
sub end_Para { $_[0]->emit_par( 0) } |
67
|
58
|
|
|
58
|
0
|
108
|
sub end_item_bullet { $_[0]->emit_par( 0) } |
68
|
0
|
|
|
0
|
0
|
0
|
sub end_item_number { $_[0]->emit_par( 0) } |
69
|
365
|
|
|
365
|
0
|
689
|
sub end_item_text { $_[0]->emit_par(-2) } |
70
|
124
|
100
|
|
124
|
0
|
350
|
sub start_L { $_[0]{'Link'} = $_[1] if $_[1]->{type} eq 'url' } |
71
|
|
|
|
|
|
|
sub end_L { |
72
|
124
|
100
|
|
124
|
0
|
347
|
if (my $link = delete $_[0]{'Link'}) { |
73
|
|
|
|
|
|
|
# Append the URL to the output unless it's already present. |
74
|
|
|
|
|
|
|
$_[0]{'Thispara'} .= " <$link->{to}>" |
75
|
9
|
100
|
|
|
|
27
|
unless $_[0]{'Thispara'} =~ /\b\Q$link->{to}/; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub emit_par { |
80
|
1373
|
|
|
1373
|
0
|
2040
|
my($self, $tweak_indent) = splice(@_,0,2); |
81
|
1373
|
|
100
|
|
|
4039
|
my $indent = ' ' x ( 2 * $self->{'Indent'} + 4 + ($tweak_indent||0) ); |
82
|
|
|
|
|
|
|
# Yes, 'STRING' x NEGATIVE gives '', same as 'STRING' x 0 |
83
|
|
|
|
|
|
|
|
84
|
1373
|
|
|
|
|
3373
|
$self->{'Thispara'} =~ s/$Pod::Simple::shy//g; |
85
|
1373
|
|
|
|
|
2946
|
my $out = Text::Wrap::wrap($indent, $indent, $self->{'Thispara'} .= "\n"); |
86
|
1373
|
|
|
|
|
384521
|
$out =~ s/$Pod::Simple::nbsp/ /g; |
87
|
1373
|
|
|
|
|
1561
|
print {$self->{'output_fh'}} $out, "\n"; |
|
1373
|
|
|
|
|
4796
|
|
88
|
1373
|
|
|
|
|
2067
|
$self->{'Thispara'} = ''; |
89
|
|
|
|
|
|
|
|
90
|
1373
|
|
|
|
|
2416
|
return; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
# . . . . . . . . . . And then off by its lonesome: |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub end_Verbatim { |
96
|
146
|
|
|
146
|
0
|
196
|
my $self = shift; |
97
|
146
|
|
|
|
|
341
|
$self->{'Thispara'} =~ s/$Pod::Simple::nbsp/ /g; |
98
|
146
|
|
|
|
|
268
|
$self->{'Thispara'} =~ s/$Pod::Simple::shy//g; |
99
|
|
|
|
|
|
|
|
100
|
146
|
|
|
|
|
304
|
my $i = ' ' x ( 2 * $self->{'Indent'} + 4); |
101
|
|
|
|
|
|
|
#my $i = ' ' x (4 + $self->{'Indent'}); |
102
|
|
|
|
|
|
|
|
103
|
146
|
|
|
|
|
788
|
$self->{'Thispara'} =~ s/^/$i/mg; |
104
|
|
|
|
|
|
|
|
105
|
146
|
|
|
|
|
569
|
print { $self->{'output_fh'} } '', |
106
|
146
|
|
|
|
|
226
|
$self->{'Thispara'}, |
107
|
|
|
|
|
|
|
"\n\n" |
108
|
|
|
|
|
|
|
; |
109
|
146
|
|
|
|
|
221
|
$self->{'Thispara'} = ''; |
110
|
146
|
|
|
|
|
235
|
return; |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
114
|
|
|
|
|
|
|
1; |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
__END__ |