line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MKDoc::Text::Structured::PRE; |
2
|
20
|
|
|
20
|
|
125
|
use base qw /MKDoc::Text::Structured::Base/; |
|
20
|
|
|
|
|
36
|
|
|
20
|
|
|
|
|
1576
|
|
3
|
20
|
|
|
20
|
|
194
|
use MKDoc::Text::Structured::Inline; |
|
20
|
|
|
|
|
39
|
|
|
20
|
|
|
|
|
418
|
|
4
|
20
|
|
|
20
|
|
121
|
use warnings; |
|
20
|
|
|
|
|
43
|
|
|
20
|
|
|
|
|
514
|
|
5
|
20
|
|
|
20
|
|
132
|
use strict; |
|
20
|
|
|
|
|
38
|
|
|
20
|
|
|
|
|
7870
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new |
9
|
|
|
|
|
|
|
{ |
10
|
258
|
|
|
258
|
0
|
354
|
my $class = shift; |
11
|
258
|
|
|
|
|
325
|
my $line = shift; |
12
|
|
|
|
|
|
|
|
13
|
258
|
100
|
|
|
|
1189
|
$line =~ s/^\s*$// and return; |
14
|
|
|
|
|
|
|
|
15
|
216
|
|
|
|
|
445
|
my ($indent) = $line =~ /^(\s+)/; |
16
|
216
|
100
|
|
|
|
1610
|
return unless ($indent); |
17
|
|
|
|
|
|
|
|
18
|
11
|
|
|
|
|
64
|
my $self = $class->SUPER::new(); |
19
|
11
|
|
|
|
|
50
|
$self->{indent} = $indent; |
20
|
11
|
|
|
|
|
83
|
return $self; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub is_ok |
25
|
|
|
|
|
|
|
{ |
26
|
22
|
|
|
22
|
0
|
28
|
my $self = shift; |
27
|
22
|
|
|
|
|
29
|
my $line = shift; |
28
|
22
|
|
|
|
|
88
|
return $line =~ /^\s/; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub process |
33
|
|
|
|
|
|
|
{ |
34
|
9
|
|
|
9
|
0
|
14
|
my $self = shift; |
35
|
9
|
|
|
|
|
13
|
my @lines = @{$self->{lines}}; |
|
9
|
|
|
|
|
31
|
|
36
|
9
|
|
|
|
|
18
|
my $indent = $self->{indent}; |
37
|
9
|
|
|
|
|
19
|
for (@lines) |
38
|
|
|
|
|
|
|
{ |
39
|
15
|
|
|
|
|
52
|
my ($_indent) = $_ =~ /^(\s+)/; |
40
|
15
|
100
|
|
|
|
71
|
$indent = $_indent if (length ($_indent) lt length ($indent)); |
41
|
|
|
|
|
|
|
} |
42
|
9
|
|
|
|
|
23
|
my $text = join "\n", map { s/^$indent//; $_ } @lines; |
|
15
|
|
|
|
|
152
|
|
|
15
|
|
|
|
|
55
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
# minimal encoding since we don't want all |
45
|
|
|
|
|
|
|
# the inline fluff |
46
|
9
|
|
|
|
|
23
|
$text =~ s/&/&/g; |
47
|
9
|
|
|
|
|
15
|
$text =~ s/</g; |
48
|
9
|
|
|
|
|
20
|
$text =~ s/>/>/g; |
49
|
|
|
|
|
|
|
|
50
|
9
|
|
|
|
|
51
|
return "$text "; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
__END__ |