Branch Coverage

blib/lib/Markdown/Perl/Inlines.pm
Criterion Covered Total %
branch 189 194 97.4


line true false branch
46 24308 20257 if ($that->get_use_extended_autolinks)
107 18908 31238 if ($+{'code'}) { }
111 3803 15105 if ($text =~ /(?
113 3165 638 if $start_before > 0
125 8130 23108 if ($text =~ /\G(?$re)>/u) { }
4 23104 elsif ($text =~ /\G(?$email_re)>/u) { }
14487 8617 elsif ($text =~ /\G(?:$html_tag_re)>/u) { }
126 6991 1139 if $start_before > 0
131 0 4 if $start_before > 0
139 13682 805 if $start_before > 0
147 42313 2252 if $text
156 11937 80638 if ($node->{'type'} eq 'code' or $node->{'type'} eq 'link') { }
66151 14487 elsif ($node->{'type'} eq 'text') { }
14487 0 elsif ($node->{'type'} eq 'html') { }
172 77 80 if $Markdown::Perl::Inlines::LAST_MATCH_START[0] > 0
177 66144 7 if $node->{'content'}
200 26552 67950 if $n->{'type'} ne "text"
203 41600 50499 if ($+{'open'}) { }
204 8121 33479 $pos[2] - $pos[1] > 1 ? :
207 20194 30305 unless @open_link
209 57 30248 unless $open{'active'}
215 28040 2208 unless %target
222 1394 814 if ($open{'type'} eq "link")
224 170 113 if $_->{'type'} eq "link"
246 0 30248 unless $n->{'type'} eq "text"
253 3948 26300 if (exists $+{'inline'}) { }
912 25388 elsif (exists $+{'reference'}) { }
256 632 280 if ($+{'reference'} eq '[') { }
266 2127 28121 if ($has_space)
270 9 2118 if ($mode eq 'reference' and $type eq 'reference' || $type eq 'collapsed' and $+{'space'} =~ /^ ?(?:\n[ \t]*)?$/u) { }
280 3887 26361 if ($type eq 'inline') { }
564 25797 elsif ($type eq 'reference') { }
282 2014 1873 if @target
287 45 519 if exists $target{'target'}
291 380 139 if %target
297 19269 8540 if $ref
298 149 27660 if (my $l = get_linkref($that, $linkrefs, $ref))
299 18 131 if $type eq "collapsed"
333 44 3843 if ($has_bracket) { }
105 3738 elsif (length $n->{'content'} <= $search_start and @{$tree->{'children'};} > $cur_child + 1 and $tree->{'children'}[$cur_child + 1]{'type'} eq 'html' || $tree->{'children'}[$cur_child + 1]{'type'} eq 'link') { }
3037 701 elsif (my(@end_target) = $tree->find_in_text_with_balanced_content(qr/\(/u, qr/\)/u, qr/[ [:cntrl:]]/u, $cur_child, $search_start)) { }
334 20 24 if (my(@end_target) = $tree->find_in_text(qr/>/u, $cur_child, $search_start + 1))
336 2 18 if $tree->find_in_text(qr/<|\n/u, @target)
348 7 98 if @{$tree->{'children'};} <= $cur_child + 2
351 64 34 if ($link_node->{'type'} eq 'html') { }
357 2 96 if $target =~ /\n/u
365 3151 725 if (@target)
373 18 3133 $has_bracket ? :
384 42 3834 if ($n->{'content'} =~ /\G"/cgu) { }
4 3830 elsif ($n->{'content'} =~ /\G'/cgu) { }
59 3771 elsif ($n->{'content'} =~ /\G\(/cgu) { }
392 55 3821 if (@end_title)
393 9 46 unless $ok_to_have_title
406 1853 2014 unless $n->{'content'} =~ /\G\)/u
417 24 1990 if (@title)
424 2014 0 if (@target)
426 2010 4 unless $target
432 24 1990 $title ? :
443 425 139 if (my(@end_ref) = $tree->find_in_text(qr/]/u, $cur_child, $start[3]))
446 45 380 if (my $l = get_linkref($that, $linkrefs, $ref)) { }
463 188 28046 if (exists $linkrefs->{$ref}) { }
7 28039 elsif (exists $that->{'hooks'}{'resolve_link_ref'}) { }
482 2208 95699 if exists $n->{'subtree'}
483 28760 69147 unless $n->{'type'} eq "text"
487 48529 20618 if ($that->get_two_spaces_hard_line_breaks) { }
495 42512 34373 if not $not_root and $i == 0 and $j == 0
498 41930 34955 if not $not_root and $i == $#{$$tree{"children"};} and $j == $#hard_breaks
499 69147 10133 if ($j == 0) { }
526 2208 116746 if exists $c->{'subtree'}
544 40875 2 if (not exists $max_delim_run_length{$d->{'delim'}} or $d->{'len'} <= $max_delim_run_length{$d->{'delim'}})
574 8503 32374 if ($delim eq '_') { }
599 3356 78398 if $index == 0 and $side eq "left"
600 2996 75402 if $index == $#{$$tree{"children"};} and $side eq "right"
601 37521 37881 $side eq 'left' ? :
604 3883 71519 if $node->{'type'} ne "text" and $node->{'type'} ne "literal"
605 35923 35596 $side eq 'left' ? :
606 7986 63533 if $node->{'content'} =~ /$space_re/u
607 31091 32442 $side eq 'left' ? :
608 40010 23523 if $node->{'content'} =~ /$punct_re/u
619 4921 16128 unless $c{'can_close'}
628 11436 4136 if $_->{'can_open'} and $_->{'delim'} eq $c{'delim'}
637 5891 10237 if $open_index == -1
675 337 9900 if ($len < $o{'len'}) { }
684 409 9828 if ($len < $c{'len'}) { }
696 337 9900 $len < $o{'len'} ? :
741 10232 5 exists $that->get_inline_delimiters->{$delim x 2} ? :
746 18330 40408 if ($n->{'type'} ne "text")
771 8 1295 if ($url =~ /\)+$/u)
776 3 5 if ($remove > 0)
781 1 1302 if ($url =~ /\&[a-zA-Z0-9]+;$/u)
786 726 577 if ($match_start > 0)
789 680 623 $has_scheme ? :
794 39157 1251 if length $n->{'content'} > 0
800 19633 39883 if ($n->{'type'} ne "text")
825 1 4 if ($match_start > 0)
828 0 5 $has_scheme ? :
837 39880 3 if length $n->{'content'} > 0