| 1 | package MKDoc::Text::Structured::LI; | ||||||||||||
| 2 | 20 | ▶ | use base qw /MKDoc::Text::Structured::Base/; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 20 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 20 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | |||||||||||||
| 6 | |||||||||||||
| 7 | sub new | ||||||||||||
| 8 | 29 | ▶ | { | ||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||
| 9 | 29 | my $class = shift; | |||||||||||
| 10 | 29 | my $line = shift; | |||||||||||
| 11 | |||||||||||||
| 12 | 29 | my ($marker) = $line =~ /^((?:\*|\-|\d+\.)\s+)/; | |||||||||||
| 13 | 29 | ▶ | return unless ($marker); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 14 | |||||||||||||
| 15 | 29 | my $self = $class->SUPER::new(); | |||||||||||
| 16 | 29 | $self->{indent_re} = " " x length ($marker); | |||||||||||
| 17 | 29 | return $self; | |||||||||||
| 18 | } | ||||||||||||
| 19 | |||||||||||||
| 20 | |||||||||||||
| 21 | sub is_ok | ||||||||||||
| 22 | 90 | ▶ | { | ||||||||||
|
Subroutine
is_ok: called CC=6 SCAR=17.9
Pod
undocumented
| |||||||||||||
| 23 | 90 | my $self = shift; | |||||||||||
| 24 | 90 | ▶ | $self->{lines} || return 1; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 25 | |||||||||||||
| 26 | 61 | ▶ | my $line = shift || ''; | ||||||||||
|
Condition100%2/2
shift() || ''
MC/DC100%1/1
shift() || ''
shift()
Truth table100%2/2
A
A= shift()
| |||||||||||||
| 27 | 61 | my $re = $self->{indent_re}; | |||||||||||
| 28 | 61 | ▶ | $line eq '' and return 1; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 29 | 45 | ▶ | $line =~ /^\s+$/ and return 1; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 30 | 44 | ▶ | $line =~ /^$re/ and return 1; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 31 | 16 | return; | |||||||||||
| 32 | } | ||||||||||||
| 33 | |||||||||||||
| 34 | |||||||||||||
| 35 | sub process | ||||||||||||
| 36 | 29 | ▶ | { | ||||||||||
|
Subroutine
process: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 37 | 29 | my $self = shift; | |||||||||||
| 38 | 29 | my @lines = @{$self->{lines}}; | |||||||||||
| 39 | |||||||||||||
| 40 | 29 | my $re = $self->{indent_re}; | |||||||||||
| 41 | 29 | for (@lines) { s/^$re// } | |||||||||||
| 42 | |||||||||||||
| 43 | 29 | my $text = join "\n", @lines; | |||||||||||
| 44 | 29 | $text =~ s/^(?:\*|\-|\d+\.)(\s+)//; | |||||||||||
| 45 | 29 | $text = MKDoc::Text::Structured::process ($text); | |||||||||||
| 46 | 29 | return "<li>$text</li>"; | |||||||||||
| 47 | } | ||||||||||||
| 48 | |||||||||||||
| 49 | |||||||||||||
| 50 | 20 | 1; | |||||||||||
| 51 | |||||||||||||
| 52 | |||||||||||||
| 53 | __END__ | ||||||||||||