| 1 | 1 | ▶ | use v5.36; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 2 | package Pod::DokuWiki 0.02; | ||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use parent qw(Pod::Simple); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use URI::Escape qw(uri_escape_utf8); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use Carp qw(croak); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | 53 | ▶ | sub _dokuwiki_escape($text) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_dokuwiki_escape: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 53 | $text =~ s{%%}{%%<nowiki>%%</nowiki>%%}g; | |||||||||||||||||||||||||||||||||||||||||
| 9 | 53 | $text = '%%' . $text . '%%'; | |||||||||||||||||||||||||||||||||||||||||
| 10 | 53 | $text =~ s/%%%%//g; | |||||||||||||||||||||||||||||||||||||||||
| 11 | 53 | $text | |||||||||||||||||||||||||||||||||||||||||
| 12 | } | ||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||
| 14 | 5 | ▶ | sub resolve_pod_link($module, $section) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
resolve_pod_link: called CC=5 SCAR=16.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | 5 | ▶ | my $to = $module // ''; | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$module // ""
MC/DC100%1/1
$module // ""
$module
Truth table100%2/2
A
A= $module
| |||||||||||||||||||||||||||||||||||||||||||
| 16 | 5 | ▶ | if (length $to) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 17 | 4 | ▶ | if ($to =~ /\Aperl\w*\z/a) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | 2 | $to = "https://perldoc.perl.org/$to"; | |||||||||||||||||||||||||||||||||||||||||
| 19 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 20 | 2 | $to = "https://metacpan.org/pod/" . uri_escape_utf8($to); | |||||||||||||||||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||||||||||||||||
| 23 | 5 | ▶ | if (length $section) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 24 | 3 | $to .= '#' . $section =~ tr[a-zA-Z0-9_/\-][-]csr; | |||||||||||||||||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||||||||||||||||
| 26 | $to | ||||||||||||||||||||||||||||||||||||||||||
| 27 | 5 | } | |||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||
| 29 | 1 | ▶ | sub resolve_man_link($n, $page, $section) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
resolve_man_link: called CC=2 SCAR=7.6
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 30 | 1 | my $to = "https://www.man7.org/linux/man-pages/man$n/" . uri_escape_utf8($page) . ".$n.html"; | |||||||||||||||||||||||||||||||||||||||||
| 31 | 1 | ▶ | if (length $section) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | $to .= '#' . uri_escape_utf8($section); | |||||||||||||||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||||||||||||||
| 34 | $to | ||||||||||||||||||||||||||||||||||||||||||
| 35 | 1 | } | |||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||
| 37 | 2 | ▶ | sub new($class, %args) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 38 | 2 | ▶ | my $resolve_pod_link = delete $args{resolve_pod_link} // \&resolve_pod_link; | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
delete $args{"resolve_pod_link"} // \&Pod::DokuWiki::resolve_pod_link
MC/DC100%1/1
delete $args{"resolve_pod_link"} // \&Pod::DokuWiki::resolve_pod_link
delete $args{"resolve_pod_link"}
Truth table100%2/2
A
A= delete $args{"resolve_pod_link"}
| |||||||||||||||||||||||||||||||||||||||||||
| 39 | 2 | ▶ | my $resolve_man_link = delete $args{resolve_man_link} // \&resolve_man_link; | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
delete $args{"resolve_man_link"} // \&Pod::DokuWiki::resolve_man_link
MC/DC100%1/1
delete $args{"resolve_man_link"} // \&Pod::DokuWiki::resolve_man_link
delete $args{"resolve_man_link"}
Truth table100%2/2
A
A= delete $args{"resolve_man_link"}
| |||||||||||||||||||||||||||||||||||||||||||
| 40 | 2 | ▶ | croak "Unrecognized constructor parameter(s) " . join(', ', map "'$_'", sort keys %args) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 41 | if %args; | ||||||||||||||||||||||||||||||||||||||||||
| 42 | 2 | my $self = $class->SUPER::new; | |||||||||||||||||||||||||||||||||||||||||
| 43 | 2 | $self->nbsp_for_S(1); | |||||||||||||||||||||||||||||||||||||||||
| 44 | 2 | $self->accept_targets('dokuwiki', 'highlighter'); | |||||||||||||||||||||||||||||||||||||||||
| 45 | 2 | ▶ | $self->strip_verbatim_indent(sub ($lines) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=5 SCAR=16.1
| |||||||||||||||||||||||||||||||||||||||||||
| 46 | 2 | my $lvl = ~0; | |||||||||||||||||||||||||||||||||||||||||
| 47 | 2 | for my $line (@$lines) { | |||||||||||||||||||||||||||||||||||||||||
| 48 | 14 | ▶ | $line =~ /\S/ or next; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 49 | 12 | my $c = $-[0]; | |||||||||||||||||||||||||||||||||||||||||
| 50 | 12 | ▶ | $lvl = $c | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 51 | if $c < $lvl; | ||||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||
| 53 | substr($_, 0, $lvl) = '' | ||||||||||||||||||||||||||||||||||||||||||
| 54 | 2 | for @$lines; | |||||||||||||||||||||||||||||||||||||||||
| 55 | undef | ||||||||||||||||||||||||||||||||||||||||||
| 56 | 2 | }); | |||||||||||||||||||||||||||||||||||||||||
| 57 | 2 | $self->{_dw_stack} = []; | |||||||||||||||||||||||||||||||||||||||||
| 58 | 2 | $self->{_dw_plain} = 0; | |||||||||||||||||||||||||||||||||||||||||
| 59 | 2 | $self->{_dw_passthrough} = 0; | |||||||||||||||||||||||||||||||||||||||||
| 60 | 2 | $self->{_dw_highlighter} = 0; | |||||||||||||||||||||||||||||||||||||||||
| 61 | 2 | $self->{_dw_list} = ''; | |||||||||||||||||||||||||||||||||||||||||
| 62 | 2 | $self->{_dw_buf} = ''; | |||||||||||||||||||||||||||||||||||||||||
| 63 | 2 | $self->{_dw_code_language} = ''; | |||||||||||||||||||||||||||||||||||||||||
| 64 | 2 | $self->{_dw_ccolumn} = 0; | |||||||||||||||||||||||||||||||||||||||||
| 65 | 2 | $self->{_dw_coffset} = 0; | |||||||||||||||||||||||||||||||||||||||||
| 66 | 2 | $self->{_dw_resolve_pod_link} = $resolve_pod_link; | |||||||||||||||||||||||||||||||||||||||||
| 67 | 2 | $self->{_dw_resolve_man_link} = $resolve_man_link; | |||||||||||||||||||||||||||||||||||||||||
| 68 | 2 | $self | |||||||||||||||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||
| 71 | 156 | ▶ | sub _emit($self, $text) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_emit: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||||
| 72 | 156 | my $n = length $text; | |||||||||||||||||||||||||||||||||||||||||
| 73 | 156 | $self->{_dw_coffset} += $n; | |||||||||||||||||||||||||||||||||||||||||
| 74 | 156 | ▶ | if ((my $p = rindex $text, "\n") >= 0) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 75 | 47 | $self->{_dw_ccolumn} = $n - $p - 1; | |||||||||||||||||||||||||||||||||||||||||
| 76 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 77 | 109 | $self->{_dw_ccolumn} += $n; | |||||||||||||||||||||||||||||||||||||||||
| 78 | } | ||||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||
| 80 | 156 | ▶ | my $fh = $self->output_fh // return; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$self->output_fh // (return)
MC/DC0%0/1
$self->output_fh // (return)
$self->output_fh
Truth table50%1/2
A
A= $self->output_fh
| |||||||||||||||||||||||||||||||||||||||||||
| 81 | 156 | print $fh $text; | |||||||||||||||||||||||||||||||||||||||||
| 82 | } | ||||||||||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||||||||||
| 84 | 24 | ▶ | sub _at_bol($self) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_at_bol: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 85 | 24 | $self->{_dw_ccolumn} == 0 | |||||||||||||||||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||||||||||
| 88 | 84 | ▶ | sub _extract_buf_verbatim($self) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_extract_buf_verbatim: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 89 | 84 | my $text = $self->{_dw_buf}; | |||||||||||||||||||||||||||||||||||||||||
| 90 | 84 | $self->{_dw_buf} = ''; | |||||||||||||||||||||||||||||||||||||||||
| 91 | 84 | $text | |||||||||||||||||||||||||||||||||||||||||
| 92 | } | ||||||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||||||
| 94 | 81 | ▶ | sub _extract_buf($self) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_extract_buf: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 95 | 81 | $self->_extract_buf_verbatim =~ tr/\r\n/ /r | |||||||||||||||||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||
| 98 | 13 | ▶ | sub _emit_item_marker($self) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_emit_item_marker: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 99 | 13 | $self->_emit(" " x length($self->{_dw_list}) . substr($self->{_dw_list}, -1) . " "); | |||||||||||||||||||||||||||||||||||||||||
| 100 | } | ||||||||||||||||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||||||||||||||
| 102 | 25 | ▶ | sub _emit_block_start($self) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_emit_block_start: called CC=4 SCAR=14.0
| |||||||||||||||||||||||||||||||||||||||||||
| 103 | 25 | ▶ | if (!$self->{_dw_list}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 104 | 24 | ▶ | $self->_emit("\n\n") if $self->{_dw_coffset}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 105 | 24 | return; | |||||||||||||||||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||
| 108 | 1 | ▶ | if ($self->_at_bol) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 109 | 0 | $self->_emit_item_marker; | |||||||||||||||||||||||||||||||||||||||||
| 110 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 111 | 1 | $self->_emit(" \\\\ "); | |||||||||||||||||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||
| 115 | sub _nop (@) {} | ||||||||||||||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||||||||||||||
| 117 | 1 | my (%handler_start, %handler_end); | |||||||||||||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||||||||||||
| 119 | 73 | ▶ | sub _handle_element_start($self, $elem, $attr, @) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_handle_element_start: called CC=2 SCAR=7.1
| |||||||||||||||||||||||||||||||||||||||||||
| 120 | 73 | push $self->{_dw_stack}->@*, [$elem]; | |||||||||||||||||||||||||||||||||||||||||
| 121 | 73 | ▶ | my $fn = $handler_start{$elem} // die "Internal error: unhandled element '$elem'"; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$handler_start{$elem} // die("Internal error: unhandled element '${elem}'")
MC/DC0%0/1
$handler_start{$elem} // die("Internal error: unhandled element '${elem}'")
$handler_start{$elem}
Truth table50%1/2
A
A= $handler_start{$elem}
| |||||||||||||||||||||||||||||||||||||||||||
| 122 | 73 | $self->$fn($attr); | |||||||||||||||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||||||||||
| 125 | 73 | ▶ | sub _handle_element_end($self, $elem, @) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_handle_element_end: called CC=2 SCAR=7.1
| |||||||||||||||||||||||||||||||||||||||||||
| 126 | 73 | ▶ | my $fn = $handler_end{$elem} // die "Internal error: unhandled element '$elem' (end)"; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$handler_end{$elem} // die("Internal error: unhandled element '${elem}' (end)")
MC/DC0%0/1
$handler_end{$elem} // die("Internal error: unhandled element '${elem}' (end)")
$handler_end{$elem}
Truth table50%1/2
A
A= $handler_end{$elem}
| |||||||||||||||||||||||||||||||||||||||||||
| 127 | 73 | $self->$fn(); | |||||||||||||||||||||||||||||||||||||||||
| 128 | 73 | pop $self->{_dw_stack}->@*; | |||||||||||||||||||||||||||||||||||||||||
| 129 | } | ||||||||||||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||||||||||||
| 131 | 78 | ▶ | sub _handle_text($self, $text, @) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_handle_text: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||||
| 132 | 78 | ▶ | if ($self->{_dw_highlighter} || !$self->{_dw_passthrough}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$self->{"_dw_highlighter"} or not $self->{"_dw_passthrough"}
MC/DC100%2/2
$self->{"_dw_highlighter"} or not $self->{"_dw_passthrough"}
$self->{"_dw_highlighter"}
not $self->{"_dw_passthrough"}
Truth table100%3/3
A or not(B)
A= $self->{"_dw_highlighter"}B= not $self->{"_dw_passthrough"}
| |||||||||||||||||||||||||||||||||||||||||||
| 133 | 77 | $self->{_dw_buf} .= $text; | |||||||||||||||||||||||||||||||||||||||||
| 134 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 135 | 1 | $self->_emit($text); | |||||||||||||||||||||||||||||||||||||||||
| 136 | } | ||||||||||||||||||||||||||||||||||||||||||
| 137 | } | ||||||||||||||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||||||||||||||
| 139 | 1 | $handler_start{Document} = \&_nop; | |||||||||||||||||||||||||||||||||||||||||
| 140 | 2 | ▶ | $handler_end{Document} = sub ($self) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.2
| |||||||||||||||||||||||||||||||||||||||||||
| 141 | 2 | ▶ | if (!$self->_at_bol) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 142 | 2 | $self->_emit("\n"); | |||||||||||||||||||||||||||||||||||||||||
| 143 | } | ||||||||||||||||||||||||||||||||||||||||||
| 144 | 1 | }; | |||||||||||||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||||||||||||
| 146 | 2 | ▶ | $handler_start{for} = sub ($self, $attr) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.1
| |||||||||||||||||||||||||||||||||||||||||||
| 147 | 2 | my $ctx = $self->{_dw_stack}[-1]; | |||||||||||||||||||||||||||||||||||||||||
| 148 | 2 | ▶ | if ($attr->{target} eq 'highlighter') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 149 | 1 | $ctx->[1] = $attr->{target}; | |||||||||||||||||||||||||||||||||||||||||
| 150 | 1 | $ctx->[2] = $self->_extract_buf_verbatim; | |||||||||||||||||||||||||||||||||||||||||
| 151 | 1 | $self->{_dw_highlighter}++; | |||||||||||||||||||||||||||||||||||||||||
| 152 | } elsif ($attr->{target} eq 'dokuwiki') { | ||||||||||||||||||||||||||||||||||||||||||
| 153 | 1 | $ctx->[1] = $attr->{target}; | |||||||||||||||||||||||||||||||||||||||||
| 154 | 1 | $self->{_dw_passthrough}++; | |||||||||||||||||||||||||||||||||||||||||
| 155 | 1 | $self->_emit("\n\n"); | |||||||||||||||||||||||||||||||||||||||||
| 156 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 157 | 0 | die "Internal error: unhandled =for target '$attr->{target}'"; | |||||||||||||||||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||||||||||||||||
| 159 | 1 | }; | |||||||||||||||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||||||||||||||||
| 161 | 2 | ▶ | $handler_end{for} = sub ($self) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=5 SCAR=16.7
| |||||||||||||||||||||||||||||||||||||||||||
| 162 | 2 | my $ctx = $self->{_dw_stack}[-1]; | |||||||||||||||||||||||||||||||||||||||||
| 163 | 2 | ▶ | if ($ctx->[1] eq 'highlighter') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 164 | 1 | my $data = $self->_extract_buf; | |||||||||||||||||||||||||||||||||||||||||
| 165 | 1 | $self->{_dw_buf} = $ctx->[2]; | |||||||||||||||||||||||||||||||||||||||||
| 166 | 1 | $self->{_dw_highlighter}--; | |||||||||||||||||||||||||||||||||||||||||
| 167 | 1 | ▶ | my %settings = | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 168 | map /\A([^=]*)=(.*)\z/s | ||||||||||||||||||||||||||||||||||||||||||
| 169 | ? ($1 => $2) | ||||||||||||||||||||||||||||||||||||||||||
| 170 | : (language => $_), | ||||||||||||||||||||||||||||||||||||||||||
| 171 | split ' ', $data; | ||||||||||||||||||||||||||||||||||||||||||
| 172 | 1 | ▶ | $self->{_dw_code_language} = $settings{language} // ''; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$settings{"language"} // ""
MC/DC0%0/1
$settings{"language"} // ""
$settings{"language"}
Truth table50%1/2
A
A= $settings{"language"}
| |||||||||||||||||||||||||||||||||||||||||||
| 173 | } elsif ($ctx->[1] eq 'dokuwiki') { | ||||||||||||||||||||||||||||||||||||||||||
| 174 | 1 | $self->{_dw_passthrough}--; | |||||||||||||||||||||||||||||||||||||||||
| 175 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 176 | 0 | die "Internal error: unhandled =for target '$ctx->[1]' (end)"; | |||||||||||||||||||||||||||||||||||||||||
| 177 | } | ||||||||||||||||||||||||||||||||||||||||||
| 178 | 1 | }; | |||||||||||||||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||||||||||||||
| 180 | 1 | $handler_start{Data} = \&_nop; | |||||||||||||||||||||||||||||||||||||||||
| 181 | 1 | $handler_end{Data} = \&_nop; | |||||||||||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||||||||||||
| 183 | 1 | for my $i (1 .. 6) { | |||||||||||||||||||||||||||||||||||||||||
| 184 | 15 | ▶ | $handler_start{'head' . $i} = sub ($self, $) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=4 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||
| 185 | 15 | my $plain = $self->{_dw_plain}++; | |||||||||||||||||||||||||||||||||||||||||
| 186 | 15 | ▶ | if ($self->{_dw_passthrough} || $self->{_dw_highlighter} || $plain) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"} or $plain
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"}
MC/DC0%0/3
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"} or $plain
$self->{"_dw_passthrough"}
$self->{"_dw_highlighter"}
$plain
Truth table25%1/4
A or B or C
A= $self->{"_dw_passthrough"}B= $self->{"_dw_highlighter"}C= $plain
| |||||||||||||||||||||||||||||||||||||||||||
| 187 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 188 | } | ||||||||||||||||||||||||||||||||||||||||||
| 189 | 15 | $self->_emit_block_start; | |||||||||||||||||||||||||||||||||||||||||
| 190 | 6 | }; | |||||||||||||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||||||||||||
| 192 | 15 | ▶ | $handler_end{'head' . $i} = sub ($self) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=6 SCAR=19.9
| |||||||||||||||||||||||||||||||||||||||||||
| 193 | 15 | $self->{_dw_plain}--; | |||||||||||||||||||||||||||||||||||||||||
| 194 | 15 | ▶ | if ($self->{_dw_passthrough} || $self->{_dw_highlighter} || $self->{_dw_plain}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"} or $self->{"_dw_plain"}
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"}
MC/DC0%0/3
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"} or $self->{"_dw_plain"}
$self->{"_dw_passthrough"}
$self->{"_dw_highlighter"}
$self->{"_dw_plain"}
Truth table25%1/4
A or B or C
A= $self->{"_dw_passthrough"}B= $self->{"_dw_highlighter"}C= $self->{"_dw_plain"}
| |||||||||||||||||||||||||||||||||||||||||||
| 195 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 196 | } | ||||||||||||||||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||||||||||||||||
| 198 | 15 | my $text = $self->_extract_buf; | |||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||
| 200 | 15 | ▶ | if ($i == 6 || $self->{_dw_list}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$i == 6 or $self->{"_dw_list"}
MC/DC50%1/2
$i == 6 or $self->{"_dw_list"}
$i == 6
$self->{"_dw_list"}
Truth table66%2/3
A or B
A= $i == 6B= $self->{"_dw_list"}
| |||||||||||||||||||||||||||||||||||||||||||
| 201 | 1 | $self->_emit('//' . _dokuwiki_escape($text) . '//'); | |||||||||||||||||||||||||||||||||||||||||
| 202 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 203 | 14 | my $marker = '=' x (7 - $i); | |||||||||||||||||||||||||||||||||||||||||
| 204 | 14 | $self->_emit("$marker $text $marker"); | |||||||||||||||||||||||||||||||||||||||||
| 205 | } | ||||||||||||||||||||||||||||||||||||||||||
| 206 | 6 | }; | |||||||||||||||||||||||||||||||||||||||||
| 207 | } | ||||||||||||||||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||||||||||||||||
| 209 | 10 | ▶ | $handler_start{Para} = sub ($self, $) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=4 SCAR=18.9
| |||||||||||||||||||||||||||||||||||||||||||
| 210 | 10 | ▶ | if ($self->{_dw_passthrough} || $self->{_dw_highlighter} || $self->{_dw_plain}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"} or $self->{"_dw_plain"}
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"}
MC/DC0%0/3
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"} or $self->{"_dw_plain"}
$self->{"_dw_passthrough"}
$self->{"_dw_highlighter"}
$self->{"_dw_plain"}
Truth table25%1/4
A or B or C
A= $self->{"_dw_passthrough"}B= $self->{"_dw_highlighter"}C= $self->{"_dw_plain"}
| |||||||||||||||||||||||||||||||||||||||||||
| 211 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 212 | } | ||||||||||||||||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||||||||||||||||
| 214 | 10 | $self->_emit_block_start; | |||||||||||||||||||||||||||||||||||||||||
| 215 | 1 | }; | |||||||||||||||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||||||||||||||||
| 217 | 10 | ▶ | $handler_end{Para} = sub ($self) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=4 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||
| 218 | 10 | ▶ | if ($self->{_dw_passthrough} || $self->{_dw_highlighter} || $self->{_dw_plain}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"} or $self->{"_dw_plain"}
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"}
MC/DC0%0/3
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"} or $self->{"_dw_plain"}
$self->{"_dw_passthrough"}
$self->{"_dw_highlighter"}
$self->{"_dw_plain"}
Truth table25%1/4
A or B or C
A= $self->{"_dw_passthrough"}B= $self->{"_dw_highlighter"}C= $self->{"_dw_plain"}
| |||||||||||||||||||||||||||||||||||||||||||
| 219 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 220 | } | ||||||||||||||||||||||||||||||||||||||||||
| 221 | |||||||||||||||||||||||||||||||||||||||||||
| 222 | 10 | my $text = $self->_extract_buf; | |||||||||||||||||||||||||||||||||||||||||
| 223 | 10 | $self->_emit(_dokuwiki_escape($text)); | |||||||||||||||||||||||||||||||||||||||||
| 224 | 1 | }; | |||||||||||||||||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||||||||||||||||
| 227 | 2 | ▶ | $handler_start{Verbatim} = sub ($self, $) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=6 SCAR=24.2
| |||||||||||||||||||||||||||||||||||||||||||
| 228 | 2 | my $plain = $self->{_dw_plain}++; | |||||||||||||||||||||||||||||||||||||||||
| 229 | 2 | ▶ | if ($self->{_dw_passthrough} || $self->{_dw_highlighter} || $plain) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"} or $plain
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"}
MC/DC0%0/3
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"} or $plain
$self->{"_dw_passthrough"}
$self->{"_dw_highlighter"}
$plain
Truth table25%1/4
A or B or C
A= $self->{"_dw_passthrough"}B= $self->{"_dw_highlighter"}C= $plain
| |||||||||||||||||||||||||||||||||||||||||||
| 230 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 231 | } | ||||||||||||||||||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||||||||||||||||
| 233 | 2 | ▶ | if ($self->{_dw_list}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 234 | 0 | $self->_emit(" "); | |||||||||||||||||||||||||||||||||||||||||
| 235 | } elsif ($self->_at_bol) { | ||||||||||||||||||||||||||||||||||||||||||
| 236 | 0 | $self->_emit("\n"); | |||||||||||||||||||||||||||||||||||||||||
| 237 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 238 | 2 | $self->_emit("\n\n"); | |||||||||||||||||||||||||||||||||||||||||
| 239 | } | ||||||||||||||||||||||||||||||||||||||||||
| 240 | 1 | }; | |||||||||||||||||||||||||||||||||||||||||
| 241 | |||||||||||||||||||||||||||||||||||||||||||
| 242 | 2 | ▶ | $handler_end{Verbatim} = sub ($self) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=7 SCAR=20.7
| |||||||||||||||||||||||||||||||||||||||||||
| 243 | 2 | $self->{_dw_plain}--; | |||||||||||||||||||||||||||||||||||||||||
| 244 | 2 | ▶ | if ($self->{_dw_passthrough} || $self->{_dw_highlighter} || $self->{_dw_plain}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"} or $self->{"_dw_plain"}
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"}
MC/DC0%0/3
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"} or $self->{"_dw_plain"}
$self->{"_dw_passthrough"}
$self->{"_dw_highlighter"}
$self->{"_dw_plain"}
Truth table25%1/4
A or B or C
A= $self->{"_dw_passthrough"}B= $self->{"_dw_highlighter"}C= $self->{"_dw_plain"}
| |||||||||||||||||||||||||||||||||||||||||||
| 245 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 246 | } | ||||||||||||||||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||||||||||||||||
| 248 | 2 | my $text = $self->_extract_buf_verbatim; | |||||||||||||||||||||||||||||||||||||||||
| 249 | |||||||||||||||||||||||||||||||||||||||||||
| 250 | 2 | ▶ | my $attr = $self->{_dw_code_language} ? " $self->{_dw_code_language}" : ''; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 251 | 2 | my $tag; | |||||||||||||||||||||||||||||||||||||||||
| 252 | 2 | ▶ | if ($text =~ m{</code>} && $text !~ m{</file>}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$text =~ m[</code>]u and not $text =~ m[</file>]u
MC/DC50%1/2
$text =~ m[</code>]u and not $text =~ m[</file>]u
$text =~ m[</code>]u
not $text =~ m[</file>]u
Truth table66%2/3
A and not(B)
A= $text =~ m[</code>]uB= not $text =~ m[</file>]u
| |||||||||||||||||||||||||||||||||||||||||||
| 253 | 1 | $tag = 'file'; | |||||||||||||||||||||||||||||||||||||||||
| 254 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 255 | 1 | $tag = 'code'; | |||||||||||||||||||||||||||||||||||||||||
| 256 | 1 | $text =~ s{</code\K(?=>)}{\N{U+200B}}g; | |||||||||||||||||||||||||||||||||||||||||
| 257 | } | ||||||||||||||||||||||||||||||||||||||||||
| 258 | 2 | $self->_emit("<$tag$attr>\n$text\n</$tag>"); | |||||||||||||||||||||||||||||||||||||||||
| 259 | 1 | }; | |||||||||||||||||||||||||||||||||||||||||
| 260 | |||||||||||||||||||||||||||||||||||||||||||
| 261 | 13 | ▶ | $handler_start{L} = sub ($self, $attr) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=8 SCAR=22.4
| |||||||||||||||||||||||||||||||||||||||||||
| 262 | 13 | my $plain = $self->{_dw_plain}++; | |||||||||||||||||||||||||||||||||||||||||
| 263 | 13 | ▶ | if ($self->{_dw_passthrough} || $self->{_dw_highlighter} || $plain) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"} or $plain
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"}
MC/DC0%0/3
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"} or $plain
$self->{"_dw_passthrough"}
$self->{"_dw_highlighter"}
$plain
Truth table25%1/4
A or B or C
A= $self->{"_dw_passthrough"}B= $self->{"_dw_highlighter"}C= $plain
| |||||||||||||||||||||||||||||||||||||||||||
| 264 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 265 | } | ||||||||||||||||||||||||||||||||||||||||||
| 266 | |||||||||||||||||||||||||||||||||||||||||||
| 267 | 13 | my $text = $self->_extract_buf; | |||||||||||||||||||||||||||||||||||||||||
| 268 | 13 | $self->_emit(_dokuwiki_escape($text) . '[['); | |||||||||||||||||||||||||||||||||||||||||
| 269 | |||||||||||||||||||||||||||||||||||||||||||
| 270 | 13 | my $type = $attr->{type}; | |||||||||||||||||||||||||||||||||||||||||
| 271 | 13 | my $to = $attr->{to}; | |||||||||||||||||||||||||||||||||||||||||
| 272 | 13 | ▶ | if ($type eq 'url') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 273 | } elsif ($type eq 'man') { | ||||||||||||||||||||||||||||||||||||||||||
| 274 | 3 | ▶ | $to =~ s/\((\d+)\)\z//a or die "Internal error: unhandled 'man' link target '$to'"; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 275 | 3 | $to = $self->{_dw_resolve_man_link}($1, $to, $attr->{section}); | |||||||||||||||||||||||||||||||||||||||||
| 276 | } elsif ($type eq 'pod') { | ||||||||||||||||||||||||||||||||||||||||||
| 277 | 8 | $to = $self->{_dw_resolve_pod_link}($to, $attr->{section}); | |||||||||||||||||||||||||||||||||||||||||
| 278 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 279 | 0 | die "Internal error: unhandled link type '$type'"; | |||||||||||||||||||||||||||||||||||||||||
| 280 | } | ||||||||||||||||||||||||||||||||||||||||||
| 281 | |||||||||||||||||||||||||||||||||||||||||||
| 282 | 13 | $to =~ s/\[/%5B/g; | |||||||||||||||||||||||||||||||||||||||||
| 283 | 13 | $to =~ s/\]/%5D/g; | |||||||||||||||||||||||||||||||||||||||||
| 284 | 13 | $to =~ s/\|/%7C/g; | |||||||||||||||||||||||||||||||||||||||||
| 285 | |||||||||||||||||||||||||||||||||||||||||||
| 286 | 13 | $self->_emit("$to|"); | |||||||||||||||||||||||||||||||||||||||||
| 287 | 1 | }; | |||||||||||||||||||||||||||||||||||||||||
| 288 | |||||||||||||||||||||||||||||||||||||||||||
| 289 | 13 | ▶ | $handler_end{L} = sub ($self) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=4 SCAR=17.2
| |||||||||||||||||||||||||||||||||||||||||||
| 290 | 13 | $self->{_dw_plain}--; | |||||||||||||||||||||||||||||||||||||||||
| 291 | 13 | ▶ | if ($self->{_dw_passthrough} || $self->{_dw_highlighter} || $self->{_dw_plain}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"} or $self->{"_dw_plain"}
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"}
MC/DC0%0/3
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"} or $self->{"_dw_plain"}
$self->{"_dw_passthrough"}
$self->{"_dw_highlighter"}
$self->{"_dw_plain"}
Truth table25%1/4
A or B or C
A= $self->{"_dw_passthrough"}B= $self->{"_dw_highlighter"}C= $self->{"_dw_plain"}
| |||||||||||||||||||||||||||||||||||||||||||
| 292 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 293 | } | ||||||||||||||||||||||||||||||||||||||||||
| 294 | |||||||||||||||||||||||||||||||||||||||||||
| 295 | 13 | my $text = $self->_extract_buf; | |||||||||||||||||||||||||||||||||||||||||
| 296 | 13 | $self->_emit($text =~ s/\]\K(?=\])/\N{U+200B}/gr . ']]'); | |||||||||||||||||||||||||||||||||||||||||
| 297 | 1 | }; | |||||||||||||||||||||||||||||||||||||||||
| 298 | |||||||||||||||||||||||||||||||||||||||||||
| 299 | { | ||||||||||||||||||||||||||||||||||||||||||
| 300 | 1 | my %markup = ( | |||||||||||||||||||||||||||||||||||||||||
| 301 | B => "**", | ||||||||||||||||||||||||||||||||||||||||||
| 302 | C => "''", | ||||||||||||||||||||||||||||||||||||||||||
| 303 | I => "//", | ||||||||||||||||||||||||||||||||||||||||||
| 304 | U => "__", | ||||||||||||||||||||||||||||||||||||||||||
| 305 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 306 | |||||||||||||||||||||||||||||||||||||||||||
| 307 | 1 | for my $fmt (keys %markup) { | |||||||||||||||||||||||||||||||||||||||||
| 308 | 4 | my $marker = $markup{$fmt}; | |||||||||||||||||||||||||||||||||||||||||
| 309 | 16 | ▶ | $handler_start{$fmt} = $handler_end{$fmt} = sub ($self, @) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=4 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||
| 310 | 16 | ▶ | if ($self->{_dw_passthrough} || $self->{_dw_highlighter} || $self->{_dw_plain}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"} or $self->{"_dw_plain"}
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"}
MC/DC0%0/3
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"} or $self->{"_dw_plain"}
$self->{"_dw_passthrough"}
$self->{"_dw_highlighter"}
$self->{"_dw_plain"}
Truth table25%1/4
A or B or C
A= $self->{"_dw_passthrough"}B= $self->{"_dw_highlighter"}C= $self->{"_dw_plain"}
| |||||||||||||||||||||||||||||||||||||||||||
| 311 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 312 | } | ||||||||||||||||||||||||||||||||||||||||||
| 313 | 16 | my $text = $self->_extract_buf; | |||||||||||||||||||||||||||||||||||||||||
| 314 | 16 | $self->_emit(_dokuwiki_escape($text) . $marker); | |||||||||||||||||||||||||||||||||||||||||
| 315 | 4 | }; | |||||||||||||||||||||||||||||||||||||||||
| 316 | } | ||||||||||||||||||||||||||||||||||||||||||
| 317 | } | ||||||||||||||||||||||||||||||||||||||||||
| 318 | |||||||||||||||||||||||||||||||||||||||||||
| 319 | { | ||||||||||||||||||||||||||||||||||||||||||
| 320 | 1 | my %marker = ( | |||||||||||||||||||||||||||||||||||||||||
| 321 | number => '-', | ||||||||||||||||||||||||||||||||||||||||||
| 322 | bullet => '*', | ||||||||||||||||||||||||||||||||||||||||||
| 323 | text => '*', | ||||||||||||||||||||||||||||||||||||||||||
| 324 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 325 | |||||||||||||||||||||||||||||||||||||||||||
| 326 | 1 | for my $list_type (keys %marker) { | |||||||||||||||||||||||||||||||||||||||||
| 327 | 3 | my $marker = $marker{$list_type}; | |||||||||||||||||||||||||||||||||||||||||
| 328 | |||||||||||||||||||||||||||||||||||||||||||
| 329 | 6 | ▶ | $handler_start{"over-$list_type"} = sub ($self, $) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 330 | 6 | $self->{_dw_list} .= $marker; | |||||||||||||||||||||||||||||||||||||||||
| 331 | 3 | }; | |||||||||||||||||||||||||||||||||||||||||
| 332 | |||||||||||||||||||||||||||||||||||||||||||
| 333 | 6 | ▶ | $handler_end{"over-$list_type"} = sub ($self) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=5 SCAR=18.9
| |||||||||||||||||||||||||||||||||||||||||||
| 334 | 6 | chop $self->{_dw_list}; | |||||||||||||||||||||||||||||||||||||||||
| 335 | 6 | ▶ | if ($self->{_dw_passthrough} || $self->{_dw_highlighter} || $self->{_dw_plain}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"} or $self->{"_dw_plain"}
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"}
MC/DC0%0/3
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"} or $self->{"_dw_plain"}
$self->{"_dw_passthrough"}
$self->{"_dw_highlighter"}
$self->{"_dw_plain"}
Truth table25%1/4
A or B or C
A= $self->{"_dw_passthrough"}B= $self->{"_dw_highlighter"}C= $self->{"_dw_plain"}
| |||||||||||||||||||||||||||||||||||||||||||
| 336 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 337 | } | ||||||||||||||||||||||||||||||||||||||||||
| 338 | 6 | ▶ | if (!$self->_at_bol) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 339 | 5 | $self->_emit("\n"); | |||||||||||||||||||||||||||||||||||||||||
| 340 | } | ||||||||||||||||||||||||||||||||||||||||||
| 341 | 3 | }; | |||||||||||||||||||||||||||||||||||||||||
| 342 | |||||||||||||||||||||||||||||||||||||||||||
| 343 | 13 | ▶ | $handler_start{"item-$list_type"} = sub ($self, $) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=6 SCAR=19.6
| |||||||||||||||||||||||||||||||||||||||||||
| 344 | 13 | ▶ | if ($self->{_dw_passthrough} || $self->{_dw_highlighter} || $self->{_dw_plain}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"} or $self->{"_dw_plain"}
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"}
MC/DC0%0/3
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"} or $self->{"_dw_plain"}
$self->{"_dw_passthrough"}
$self->{"_dw_highlighter"}
$self->{"_dw_plain"}
Truth table25%1/4
A or B or C
A= $self->{"_dw_passthrough"}B= $self->{"_dw_highlighter"}C= $self->{"_dw_plain"}
| |||||||||||||||||||||||||||||||||||||||||||
| 345 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 346 | } | ||||||||||||||||||||||||||||||||||||||||||
| 347 | 13 | ▶ | if (!$self->_at_bol) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 348 | 12 | $self->_emit("\n"); | |||||||||||||||||||||||||||||||||||||||||
| 349 | } | ||||||||||||||||||||||||||||||||||||||||||
| 350 | 13 | $self->_emit_item_marker; | |||||||||||||||||||||||||||||||||||||||||
| 351 | |||||||||||||||||||||||||||||||||||||||||||
| 352 | 13 | ▶ | if ($list_type eq 'text') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 353 | 1 | $self->_emit("//"); | |||||||||||||||||||||||||||||||||||||||||
| 354 | } | ||||||||||||||||||||||||||||||||||||||||||
| 355 | 3 | }; | |||||||||||||||||||||||||||||||||||||||||
| 356 | |||||||||||||||||||||||||||||||||||||||||||
| 357 | 13 | ▶ | $handler_end{"item-$list_type"} = sub ($self) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=5 SCAR=18.4
| |||||||||||||||||||||||||||||||||||||||||||
| 358 | 13 | ▶ | if ($self->{_dw_passthrough} || $self->{_dw_highlighter} || $self->{_dw_plain}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"} or $self->{"_dw_plain"}
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"}
MC/DC0%0/3
$self->{"_dw_passthrough"} or $self->{"_dw_highlighter"} or $self->{"_dw_plain"}
$self->{"_dw_passthrough"}
$self->{"_dw_highlighter"}
$self->{"_dw_plain"}
Truth table25%1/4
A or B or C
A= $self->{"_dw_passthrough"}B= $self->{"_dw_highlighter"}C= $self->{"_dw_plain"}
| |||||||||||||||||||||||||||||||||||||||||||
| 359 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 360 | } | ||||||||||||||||||||||||||||||||||||||||||
| 361 | 13 | my $text = $self->_extract_buf; | |||||||||||||||||||||||||||||||||||||||||
| 362 | 13 | $self->_emit(_dokuwiki_escape($text)); | |||||||||||||||||||||||||||||||||||||||||
| 363 | 13 | ▶ | if ($list_type eq 'text') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 364 | 1 | $self->_emit("//"); | |||||||||||||||||||||||||||||||||||||||||
| 365 | } | ||||||||||||||||||||||||||||||||||||||||||
| 366 | 3 | }; | |||||||||||||||||||||||||||||||||||||||||
| 367 | } | ||||||||||||||||||||||||||||||||||||||||||
| 368 | } | ||||||||||||||||||||||||||||||||||||||||||
| 369 | |||||||||||||||||||||||||||||||||||||||||||
| 370 | 'ok' | ||||||||||||||||||||||||||||||||||||||||||
| 371 | |||||||||||||||||||||||||||||||||||||||||||
| 372 | 1 | __END__ | |||||||||||||||||||||||||||||||||||||||||