Branch Coverage

blib/lib/HTML/Laundry.pm
Criterion Covered Total %
branch 131 160 81.8


line true false branch
144 1 24 if (&blessed($args)) { }
4 20 elsif (ref $args ne 'HASH') { }
145 1 0 if ($args->isa('HTML::Laundry::Rules')) { }
157 1 2 if $args->isa('HTML::Laundry::Rules')
161 1 3 if ($rules) { }
200 8 17 unless ($args->{'notidy'})
222 4 21 if $args->{'base_uri'}
259 0 21 if ref $ref ne 'CODE'
260 4 17 if ($action eq 'start_tag') { }
4 13 elsif ($action eq 'end_tag') { }
6 7 elsif ($action eq 'text') { }
4 3 elsif ($action eq 'uri') { }
3 0 elsif ($action eq 'output') { }
284 27 112 if ($action eq 'start_tag') { }
27 85 elsif ($action eq 'end_tag') { }
29 56 elsif ($action eq 'text') { }
29 27 elsif ($action eq 'uri') { }
27 0 elsif ($action eq 'output') { }
311 0 462 if ($self->{'trim_tag_whitespace'})
317 461 1 unless ($in_cdata or $unacceptable_count)
320 0 462 if ($in_cdata and not $local_unacceptable_count)
325 4 458 if ($cdata_dirty) { }
354 2 1 if (defined $new_base and not ref $new_base)
363 0 1623 unless $action
367 4 1646 unless $result
385 0 462 unless ($self->_run_callbacks('output', \@fragments))
389 0 462 if ($self->{'tidy'})
390 0 0 if ($self->{'tidy_engine'} eq 'HTML::Tidy') { }
0 0 elsif ($self->{'tidy_engine'} eq 'HTML::Tidy::libXML') { }
403 462 0 if ($self->{'trim_trailing_whitespace'})
418 0 0 if ($listref)
440 1 3 if (ref $new_e eq 'ARRAY') { }
460 1 3 if (ref $listref eq 'ARRAY')
490 2 8 if (ref $new_e eq 'ARRAY') { }
497 4 4 if ($args->{'empty'}) { }
0 4 elsif ($self->{'tidy'}) { }
499 0 4 if ($self->{'tidy'})
530 2 14 if (ref $new_e eq 'ARRAY') { }
550 1 2 if (ref $listref eq 'ARRAY')
573 1 3 if (ref $new_e eq 'ARRAY') { }
602 1 3 if (ref $new_e eq 'ARRAY') { }
622 1 2 if (ref $listref eq 'ARRAY')
656 1 3 if (ref $new_a eq 'ARRAY') { }
683 1 3 if (ref $new_a eq 'ARRAY') { }
698 8 0 unless ($self->{'tidy'})
730 0 0 if (keys %{$$self{'tidy_added_inline'};})
734 0 0 if (keys %{$$self{'tidy_added_empty'};})
757 1 492 unless ($self->_run_callbacks('start_tag', \$tagname, $attr))
760 487 5 unless ($in_cdata)
765 174 85 if ($self->{'acceptable_a'}{$k})
766 58 116 if (grep {/^$k$/;} @{$$self{'uri_list'}{$tagname};})
772 157 17 if ($k)
778 376 116 if ($self->{'acceptable_e'}{$tagname}) { }
779 58 318 if ($self->{'empty_e'}{$tagname}) { }
780 19 39 if ($attributes)
786 122 196 if ($attributes)
793 24 92 if ($self->{'unacceptable_e'}{$tagname})
794 3 21 if ($in_cdata) { }
807 1 466 unless ($self->_run_callbacks('end_tag', \$tagname))
810 463 3 unless ($in_cdata)
813 346 120 if ($self->{'acceptable_e'}{$tagname}) { }
814 316 30 unless ($self->{'empty_e'}{$tagname})
819 30 90 if ($self->{'unacceptable_e'}{$tagname})
820 1 29 if ($in_cdata) { }
822 0 1 if $local_unacceptable_count < 0
827 8 21 if $unacceptable_count < 0
836 1 171 if ($in_cdata and $local_unacceptable_count)
839 15 156 if ($unacceptable_count)
842 13 143 if ($is_cdata) { }
846 11 2 unless ($local_unacceptable_count)
854 1 142 unless ($self->_run_callbacks('text', \$text, $is_cdata))
871 1 57 unless ($self->_run_callbacks('uri', $tagname, $attr, \$uri))
875 42 15 if ($self->{'allowed_schemes'} and $uri->scheme)
876 16 26 unless ($self->{'allowed_schemes'}{$uri->scheme})
881 8 33 if ($self->{'base_uri'})
884 33 8 if ($uri->scheme)
890 33 0 if ($host)
896 0 33 if ($uri->host ne $utf8_host)
900 0 0 if ($uri->port and $uri->port == $uri->default_port)
920 33 0 if utf8::decode($str)