| 1 | package Text::HTML::Turndown::Tasklistitems 0.12; | ||||||||||||||||||||
| 2 | 1 | ▶ | use 5.020; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 1 | ▶ | use experimental 'signatures'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 1 | ▶ | use stable 'postderef'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 1 | ▶ | use List::MoreUtils 'all'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | our %RULES = ( | ||||||||||||||||||||
| 8 | taskListItems => { | ||||||||||||||||||||
| 9 | 215 | ▶ | filter => sub ($rule, $node, $options) { | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.2
| |||||||||||||||||||||
| 10 | 215 | ▶ | return lc $node->getAttribute('type') eq 'checkbox' | ||||||||||||||||||
|
Condition66%2/3
lc $node->getAttribute('type') eq 'checkbox' && uc $node->parentNode->nodeName eq 'LI'
MC/DC50%1/2
lc $node->getAttribute('type') eq 'checkbox' && uc $node->parentNode->nodeName eq 'LI'
lc $node->getAttribute('type') eq 'checkbox'
uc $node->parentNode->nodeName eq 'LI'
Truth table66%2/3
A && B
A= lc $node->getAttribute('type') eq 'checkbox'B= uc $node->parentNode->nodeName eq 'LI'
| |||||||||||||||||||||
| 11 | && uc $node->parentNode->nodeName eq 'LI' | ||||||||||||||||||||
| 12 | }, | ||||||||||||||||||||
| 13 | 4 | ▶ | replacement => sub( $content, $node, $options, $context ) { | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||||||||||||
| 14 | 4 | ▶ | return (defined $node->getAttribute('checked') ? '[x]' : '[ ]') . ' ' | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 15 | } | ||||||||||||||||||||
| 16 | }, | ||||||||||||||||||||
| 17 | 1 | ); | |||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | 22 | ▶ | sub install ($class, $target) { | ||||||||||||||||||
|
Subroutine
install: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 20 | 22 | for my $key (keys %RULES) { | |||||||||||||||||||
| 21 | 22 | $target->addRule($key, $RULES{$key}) | |||||||||||||||||||
| 22 | } | ||||||||||||||||||||
| 23 | } | ||||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | 1 | 1; | |||||||||||||||||||