line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MKDoc::Text::Structured::LI; |
2
|
20
|
|
|
20
|
|
103
|
use base qw /MKDoc::Text::Structured::Base/; |
|
20
|
|
|
|
|
32
|
|
|
20
|
|
|
|
|
1721
|
|
3
|
20
|
|
|
20
|
|
112
|
use warnings; |
|
20
|
|
|
|
|
38
|
|
|
20
|
|
|
|
|
476
|
|
4
|
20
|
|
|
20
|
|
103
|
use strict; |
|
20
|
|
|
|
|
35
|
|
|
20
|
|
|
|
|
8157
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new |
8
|
|
|
|
|
|
|
{ |
9
|
29
|
|
|
29
|
0
|
97
|
my $class = shift; |
10
|
29
|
|
|
|
|
73
|
my $line = shift; |
11
|
|
|
|
|
|
|
|
12
|
29
|
|
|
|
|
129
|
my ($marker) = $line =~ /^((?:\*|\-|\d+\.)\s+)/; |
13
|
29
|
50
|
|
|
|
105
|
return unless ($marker); |
14
|
|
|
|
|
|
|
|
15
|
29
|
|
|
|
|
138
|
my $self = $class->SUPER::new(); |
16
|
29
|
|
|
|
|
144
|
$self->{indent_re} = " " x length ($marker); |
17
|
29
|
|
|
|
|
318
|
return $self; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub is_ok |
22
|
|
|
|
|
|
|
{ |
23
|
90
|
|
|
90
|
0
|
112
|
my $self = shift; |
24
|
90
|
100
|
|
|
|
273
|
$self->{lines} || return 1; |
25
|
|
|
|
|
|
|
|
26
|
61
|
|
100
|
|
|
200
|
my $line = shift || ''; |
27
|
61
|
|
|
|
|
90
|
my $re = $self->{indent_re}; |
28
|
61
|
100
|
|
|
|
220
|
$line eq '' and return 1; |
29
|
45
|
100
|
|
|
|
167
|
$line =~ /^\s+$/ and return 1; |
30
|
44
|
100
|
|
|
|
322
|
$line =~ /^$re/ and return 1; |
31
|
16
|
|
|
|
|
67
|
return; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub process |
36
|
|
|
|
|
|
|
{ |
37
|
29
|
|
|
29
|
0
|
43
|
my $self = shift; |
38
|
29
|
|
|
|
|
46
|
my @lines = @{$self->{lines}}; |
|
29
|
|
|
|
|
105
|
|
39
|
|
|
|
|
|
|
|
40
|
29
|
|
|
|
|
60
|
my $re = $self->{indent_re}; |
41
|
29
|
|
|
|
|
58
|
for (@lines) { s/^$re// } |
|
74
|
|
|
|
|
307
|
|
42
|
|
|
|
|
|
|
|
43
|
29
|
|
|
|
|
97
|
my $text = join "\n", @lines; |
44
|
29
|
|
|
|
|
120
|
$text =~ s/^(?:\*|\-|\d+\.)(\s+)//; |
45
|
29
|
|
|
|
|
140
|
$text = MKDoc::Text::Structured::process ($text); |
46
|
29
|
|
|
|
|
138
|
return "$text"; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
__END__ |