line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Pod::Simple::Text; |
2
|
6
|
|
|
6
|
|
143046
|
use strict; |
|
6
|
|
|
|
|
33
|
|
|
6
|
|
|
|
|
191
|
|
3
|
6
|
|
|
6
|
|
35
|
use warnings; |
|
6
|
|
|
|
|
14
|
|
|
6
|
|
|
|
|
158
|
|
4
|
6
|
|
|
6
|
|
27
|
use Carp (); |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
105
|
|
5
|
6
|
|
|
6
|
|
1758
|
use Pod::Simple::Methody (); |
|
6
|
|
|
|
|
15
|
|
|
6
|
|
|
|
|
136
|
|
6
|
6
|
|
|
6
|
|
32
|
use Pod::Simple (); |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
445
|
|
7
|
|
|
|
|
|
|
our $VERSION = '3.45'; |
8
|
|
|
|
|
|
|
our @ISA = ('Pod::Simple::Methody'); |
9
|
|
|
|
|
|
|
BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG) |
10
|
|
|
|
|
|
|
? \&Pod::Simple::DEBUG |
11
|
|
|
|
|
|
|
: sub() {0} |
12
|
6
|
50
|
|
6
|
|
257
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $FREAKYMODE; |
15
|
|
|
|
|
|
|
|
16
|
6
|
|
|
6
|
|
2733
|
use Text::Wrap 98.112902 (); |
|
6
|
|
|
|
|
13323
|
|
|
6
|
|
|
|
|
6762
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new { |
21
|
33
|
|
|
33
|
1
|
5460
|
my $self = shift; |
22
|
33
|
|
|
|
|
145
|
my $new = $self->SUPER::new(@_); |
23
|
33
|
|
50
|
|
|
201
|
$new->{'output_fh'} ||= *STDOUT{IO}; |
24
|
33
|
|
|
|
|
152
|
$new->accept_target_as_text(qw( text plaintext plain )); |
25
|
33
|
|
|
|
|
120
|
$new->nix_X_codes(1); |
26
|
33
|
|
|
|
|
106
|
$new->nbsp_for_S(1); |
27
|
33
|
|
|
|
|
93
|
$new->{'Thispara'} = ''; |
28
|
33
|
|
|
|
|
82
|
$new->{'Indent'} = 0; |
29
|
33
|
|
|
|
|
58
|
$new->{'Indentstring'} = ' '; |
30
|
33
|
|
|
|
|
91
|
return $new; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
34
|
|
|
|
|
|
|
|
35
|
3588
|
|
|
3588
|
0
|
10012
|
sub handle_text { $_[0]{'Thispara'} .= $_[1] } |
36
|
|
|
|
|
|
|
|
37
|
807
|
|
|
807
|
0
|
1855
|
sub start_Para { $_[0]{'Thispara'} = '' } |
38
|
45
|
|
|
45
|
0
|
130
|
sub start_head1 { $_[0]{'Thispara'} = '' } |
39
|
98
|
|
|
98
|
0
|
248
|
sub start_head2 { $_[0]{'Thispara'} = '' } |
40
|
0
|
|
|
0
|
0
|
0
|
sub start_head3 { $_[0]{'Thispara'} = '' } |
41
|
0
|
|
|
0
|
0
|
0
|
sub start_head4 { $_[0]{'Thispara'} = '' } |
42
|
|
|
|
|
|
|
|
43
|
146
|
|
|
146
|
0
|
360
|
sub start_Verbatim { $_[0]{'Thispara'} = '' } |
44
|
58
|
50
|
|
58
|
0
|
182
|
sub start_item_bullet { $_[0]{'Thispara'} = $FREAKYMODE ? '' : '* ' } |
45
|
0
|
0
|
|
0
|
0
|
0
|
sub start_item_number { $_[0]{'Thispara'} = $FREAKYMODE ? '' : "$_[1]{'number'}. " } |
46
|
365
|
|
|
365
|
0
|
870
|
sub start_item_text { $_[0]{'Thispara'} = '' } |
47
|
|
|
|
|
|
|
|
48
|
12
|
|
|
12
|
0
|
30
|
sub start_over_bullet { ++$_[0]{'Indent'} } |
49
|
0
|
|
|
0
|
0
|
0
|
sub start_over_number { ++$_[0]{'Indent'} } |
50
|
27
|
|
|
27
|
0
|
69
|
sub start_over_text { ++$_[0]{'Indent'} } |
51
|
0
|
|
|
0
|
0
|
0
|
sub start_over_block { ++$_[0]{'Indent'} } |
52
|
|
|
|
|
|
|
|
53
|
12
|
|
|
12
|
0
|
80
|
sub end_over_bullet { --$_[0]{'Indent'} } |
54
|
0
|
|
|
0
|
0
|
0
|
sub end_over_number { --$_[0]{'Indent'} } |
55
|
27
|
|
|
27
|
0
|
189
|
sub end_over_text { --$_[0]{'Indent'} } |
56
|
0
|
|
|
0
|
0
|
0
|
sub end_over_block { --$_[0]{'Indent'} } |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
# . . . . . Now the actual formatters: |
60
|
|
|
|
|
|
|
|
61
|
45
|
|
|
45
|
0
|
146
|
sub end_head1 { $_[0]->emit_par(-4) } |
62
|
98
|
|
|
98
|
0
|
360
|
sub end_head2 { $_[0]->emit_par(-3) } |
63
|
0
|
|
|
0
|
0
|
0
|
sub end_head3 { $_[0]->emit_par(-2) } |
64
|
0
|
|
|
0
|
0
|
0
|
sub end_head4 { $_[0]->emit_par(-1) } |
65
|
807
|
|
|
807
|
0
|
1766
|
sub end_Para { $_[0]->emit_par( 0) } |
66
|
58
|
|
|
58
|
0
|
137
|
sub end_item_bullet { $_[0]->emit_par( 0) } |
67
|
0
|
|
|
0
|
0
|
0
|
sub end_item_number { $_[0]->emit_par( 0) } |
68
|
365
|
|
|
365
|
0
|
839
|
sub end_item_text { $_[0]->emit_par(-2) } |
69
|
124
|
100
|
|
124
|
0
|
441
|
sub start_L { $_[0]{'Link'} = $_[1] if $_[1]->{type} eq 'url' } |
70
|
|
|
|
|
|
|
sub end_L { |
71
|
124
|
100
|
|
124
|
0
|
406
|
if (my $link = delete $_[0]{'Link'}) { |
72
|
|
|
|
|
|
|
# Append the URL to the output unless it's already present. |
73
|
|
|
|
|
|
|
$_[0]{'Thispara'} .= " <$link->{to}>" |
74
|
9
|
100
|
|
|
|
37
|
unless $_[0]{'Thispara'} =~ /\b\Q$link->{to}/; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub emit_par { |
79
|
1373
|
|
|
1373
|
0
|
2642
|
my($self, $tweak_indent) = splice(@_,0,2); |
80
|
1373
|
|
100
|
|
|
5308
|
my $indent = ' ' x ( 2 * $self->{'Indent'} + 4 + ($tweak_indent||0) ); |
81
|
|
|
|
|
|
|
# Yes, 'STRING' x NEGATIVE gives '', same as 'STRING' x 0 |
82
|
|
|
|
|
|
|
|
83
|
1373
|
|
|
|
|
4122
|
$self->{'Thispara'} =~ s/$Pod::Simple::shy//g; |
84
|
1373
|
|
|
|
|
2452
|
local $Text::Wrap::huge = 'overflow'; |
85
|
1373
|
|
|
|
|
3987
|
my $out = Text::Wrap::wrap($indent, $indent, $self->{'Thispara'} .= "\n"); |
86
|
1373
|
|
|
|
|
467341
|
$out =~ s/$Pod::Simple::nbsp/ /g; |
87
|
1373
|
|
|
|
|
2027
|
print {$self->{'output_fh'}} $out, "\n"; |
|
1373
|
|
|
|
|
7028
|
|
88
|
1373
|
|
|
|
|
2687
|
$self->{'Thispara'} = ''; |
89
|
|
|
|
|
|
|
|
90
|
1373
|
|
|
|
|
3373
|
return; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
# . . . . . . . . . . And then off by its lonesome: |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub end_Verbatim { |
96
|
146
|
|
|
146
|
0
|
271
|
my $self = shift; |
97
|
146
|
|
|
|
|
410
|
$self->{'Thispara'} =~ s/$Pod::Simple::nbsp/ /g; |
98
|
146
|
|
|
|
|
287
|
$self->{'Thispara'} =~ s/$Pod::Simple::shy//g; |
99
|
|
|
|
|
|
|
|
100
|
146
|
|
|
|
|
365
|
my $i = ' ' x ( 2 * $self->{'Indent'} + 4); |
101
|
|
|
|
|
|
|
#my $i = ' ' x (4 + $self->{'Indent'}); |
102
|
|
|
|
|
|
|
|
103
|
146
|
|
|
|
|
941
|
$self->{'Thispara'} =~ s/^/$i/mg; |
104
|
|
|
|
|
|
|
|
105
|
146
|
|
|
|
|
580
|
print { $self->{'output_fh'} } '', |
106
|
146
|
|
|
|
|
256
|
$self->{'Thispara'}, |
107
|
|
|
|
|
|
|
"\n\n" |
108
|
|
|
|
|
|
|
; |
109
|
146
|
|
|
|
|
336
|
$self->{'Thispara'} = ''; |
110
|
146
|
|
|
|
|
305
|
return; |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
114
|
|
|
|
|
|
|
1; |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
__END__ |