File Coverage

blib/lib/Text/HTML/Turndown/Strikethrough.pm
Criterion Covered Total %
statement 17 17 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 0 1 0.0
total 22 23 95.6


line stmt bran cond sub pod time code
1             package Text::HTML::Turndown::Strikethrough 0.12;
2 1     1   882 use 5.020;
  1         4  
3 1     1   6 use experimental 'signatures';
  1         18  
  1         11  
4 1     1   192 use stable 'postderef';
  1         3  
  1         8  
5 1     1   109 use List::MoreUtils 'all';
  1         2  
  1         24  
6              
7             our %RULES = (
8             strikethrough => {
9              
10             filter => ['del', 's', 'strike'],
11             replacement => sub( $content, $node, $options, $context ) {
12             return '~~' . $content . '~~'
13             }
14             }
15             );
16              
17 22     22 0 44 sub install ($class, $target) {
  22         45  
  22         47  
  22         37  
18 22         80 for my $key (keys %RULES) {
19 22         83 $target->addRule($key, $RULES{$key})
20             }
21             }
22              
23             1;