File Coverage

blib/lib/Bootylicious/Plugin/MarkdownParser.pm
Criterion Covered Total %
statement 15 18 83.3
branch 1 2 50.0
condition n/a
subroutine 5 6 83.3
pod 1 1 100.0
total 22 27 81.4


line stmt bran cond sub pod time code
1             package Bootylicious::Plugin::MarkdownParser;
2              
3 1     1   456 use strict;
  1         2  
  1         23  
4 1     1   3 use warnings;
  1         2  
  1         20  
5              
6 1     1   2 use base 'Mojolicious::Plugin';
  1         1  
  1         72  
7              
8 1     1   3 use constant MARKDOWN => eval { require Text::Markdown; 1 };
  1         1  
  1         1  
  1         294  
  0         0  
9              
10             sub register {
11 1     1 1 24 my ($self, $app) = @_;
12              
13 1 50       6 return unless MARKDOWN;
14              
15             $app->renderer->helpers->{add_parser}
16 0     0     ->(undef, md => sub { Text::Markdown->new->markdown($_[0]) });
  0            
17             }
18              
19             1;