Markdent/Simple/Fragment.pm

filter: Statementstmt 100% 41 / 41 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 12 / 12 Podpod n/a totaltotal 100% 53 / 53 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Markdent/Role/SpanParser.pm ↑ Summary Markdent/Types.pm »
1 package Markdent::Simple::Fragment;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 our $VERSION = '0.41';
8  
9 2 ▶use Markdent::Handler::HTMLStream::Fragment;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use Markdent::Parser;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶use Markdent::Types;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 2 ▶use Params::ValidationCompiler qw( validation_for );
Subroutine BEGIN: called CC=1 SCAR=0.0
13 2 ▶use Specio::Declare;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 2 ▶use MooseX::StrictConstructor;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 2 with 'Markdent::Role::Simple';
19  
20 {
21 my $validator = validation_for(
22 params => [
23 dialects => {
24 type => union(
25 of => [
26 t('Str'),
27 t( 'ArrayRef', of => t('Str') )
28 ]
29 ),
30 2 ▶ default => sub { [] },
Subroutine __ANON__: called CC=1 SCAR=0.0
31 },
32 2 markdown => { type => t('Str') },
33 ],
34 named_to_list => 1,
35 );
36  
37 2 ▶ sub markdown_to_html {
Subroutine markdown_to_html: called CC=1 SCAR=0.0
38 2 my $self = shift;
39 2 my ( $dialects, $markdown ) = $validator->(@_);
40  
41 2 my $handler_class = 'Markdent::Handler::HTMLStream::Fragment';
42  
43 2 return $self->_parse_markdown(
44 $markdown,
45 $dialects,
46 $handler_class,
47 );
48 }
49 }
50  
51 2 __PACKAGE__->meta->make_immutable;
52  
53 2 1;
54  
55 # ABSTRACT: Convert Markdown to an HTML Fragment
56  
57 __END__
« Markdent/Role/SpanParser.pm ↑ Summary Markdent/Types.pm »