Branch Coverage

blib/lib/HTML/WikiConverter.pm
Criterion Covered Total %
branch 134 198 67.6


line true false branch
85 5 5 if $pkg eq 'HTML::WikiConverter'
95 0 5 unless $opts{'dialect'}
98 5 5 if eval "use $dialect_class; 1" or $dialect_class->isa($pkg)
140 2143 545 ref $_[1] eq 'HASH' ? :
141 2143 545 $$opts{'internal'} ? :
143 296 2392 if (@value)
144 75 221 unless $$opts{'internal'}
145 0 296 if $@
147 75 221 unless $$opts{'internal'}
150 2672 16 defined $$store{$param} ? :
157 545 1 if exists $self->__attribute_specs->{$attr}
167 0 0 if $@
173 0 0 unless open my $fh, $file
200 17 7 @_ % 2 ? :
204 0 72 if exists $args{$bad}
208 0 24 unless @input_sources
209 0 24 if @input_sources > 1
215 0 24 if $file and $self->slurp
216 1 23 if $uri
217 24 0 if $html and $self->wrap_in_html
221 10 14 if $self->__attrs_changed
233 24 0 if ($html) { }
260 9 14 if ($self->__attrs_changed)
275 36 104 if ($node->tag eq '~text') { }
1 103 elsif ($node->tag eq '~comment') { }
282 5 98 if exists $$rules{'replace'}
285 4 94 if ($$rules{'preserve'}) { }
0 94 elsif ($$rules{'passthrough'}) { }
286 0 4 $$rules{'empty'} ? :
300 3 95 if $trim eq 'both' or $trim eq 'leading'
301 3 95 if $trim eq 'both' or $trim eq 'trailing'
304 3 95 if $lf ne 'none'
305 0 98 if ($lf eq 'blocks') { }
3 95 elsif ($lf eq 'multi') { }
0 95 elsif ($lf eq 'single') { }
95 0 elsif ($lf eq 'none') { }
316 3 95 if $$rules{'line_prefix'}
317 4 94 if $$rules{'__start'}
318 4 94 if $$rules{'__end'}
319 17 81 if $$rules{'start'}
320 17 81 if $$rules{'end'}
327 13 1 if $$rules{'block'} and !$self->elem_search_lineage($node, {'block', 1}) || $self->elem_search_lineage($node, {'line_format', 'blocks'})
332 1 13 if $$rules{'block'} and $node->parent->look_up('_tag', $node->tag) and $trim ne 'none'
342 0 0 if $self->rules_for_tag($n->tag || '')->{'block'}
373 29 1 unless $v eq $rule_value
376 1 29 if $matched
384 9 42 ref $subst eq 'CODE' ? :
391 0 4 exists $$rules{'attributes'} ? :
393 0 4 $$rules{'empty'} ? :
395 0 4 if $attr_str
412 24 0 if $self->normalize
414 0 23 unless $self->strip_tags
418 2 108 unless $node->tag
419 16 94 if $strip_tag{$node->tag}
420 0 94 if $passthrough_naked_tags{$node->tag} and not $node->all_external_attr_names
422 10 21 if $self->strip_empty_tags and not $allowedEmptyTag{$node->tag} and $self->__elem_is_empty($node)
423 19 65 if $node->tag eq '~text' and $self->escape_entities
424 5 79 if $self->base_uri and exists $rel2abs{$node->tag}
431 15 8 if ref $self->preprocess
438 0 23 if (ref $self->passthrough_naked_tags eq 'ARRAY') { }
0 23 elsif ($self->passthrough_naked_tags) { }
455 16 10 $content && length $content ? :
463 0 1 unless $res->is_success
471 0 0 unless eval 'use LWP::Charset; 1'
478 1 0 unless $self->user_agent
483 0 1 unless eval 'use LWP::UserAgent; 1'
492 19 0 defined $node->attr('text') ? :
501 0 5 unless $node->attr($attr)
510 94 0 defined $node->tag ? :
511 0 94 if ($containers{$tag})
518 0 0 if $node->attr('href')
555 5 0 @dialect_specs == 1 && ref $dialect_specs[0] eq 'HASH' ? :
569 1 4 if $@
582 1 0 if $error =~ /not listed in the validation options\: (\w+)/
613 184 96 unless my $spec = $meta_rules{$opt}
616 0 96 ref $$spec{'disallows'} eq 'ARRAY' ? :
617 0 96 ref $$spec{'depends'} eq 'ARRAY' ? :
618 30 66 ref $$spec{'range'} eq 'ARRAY' ? :
621 0 96 if $singleton and keys %$rules != 1
630 0 96 if @range and not exists $range{$$rules{$opt}}
645 128 0 defined $str ? :
650 5 0 ref $self->wiki_uri eq 'ARRAY' ? :
653 3 9 if $page
661 0 12 unless $wiki_uri
663 0 12 if (ref $wiki_uri eq 'Regexp') { }
3 9 elsif (ref $wiki_uri eq 'CODE') { }
664 0 0 $uri =~ /$wiki_uri/ ? :
671 7 2 unless index($uri, $wiki_uri) == 0
672 0 2 unless length $uri > length $wiki_uri
690 0 4 if $str
692 4 0 defined $str ? :
735 0 0 unless my $dh = 'DirHandle'->new($dir)
737 0 0 unless $f =~ /^(\w+)\.pm$/
740 0 0 if $seen{$dialect}++
741 0 0 if $dialect eq 'Normalizer' or $dialect eq 'WebApp'
747 0 0 wantarray ? :
763 9 124 $$rules{'alias'} ? :
768 51 91 if $self->__rules->{$tag}
769 0 91 if $self->__rules->{'UNKNOWN'} and not $isKnownTag{$tag}