File Coverage

lib/Kwiki/Autoformat.pm
Criterion Covered Total %
statement 7 9 77.7
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 10 12 83.3


line stmt bran cond sub pod time code
1             package Kwiki::Autoformat;
2 1     1   29119 use strict;
  1         3  
  1         54  
3 1     1   6 use warnings;
  1         5  
  1         177  
4              
5 1     1   690 use Kwiki::Plugin -Base;
  0            
  0            
6             use Kwiki::Installer -mixin;
7              
8             our $VERSION = 0.03;
9              
10             const class_title => 'Text autoformat';
11             const class_id => 'autoformat';
12              
13             sub register {
14             my $registry = shift;
15             $registry->add(wafl => auto => 'Kwiki::Autoformat::Wafl');
16             $registry->add(wafl => autoformat => 'Kwiki::Autoformat::Wafl');
17             }
18              
19             package Kwiki::Autoformat::Wafl;
20             use base 'Spoon::Formatter::WaflBlock';
21              
22             sub to_html {
23             require Text::Autoformat;
24             my $text = Text::Autoformat::autoformat($self->block_text);
25             $text =~ s/\n+//s;
26             return "
$text
";
27             }
28              
29             package Kwiki::Autoformat;
30              
31             __DATA__