| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Articulate::Augmentation::Interpreter::Markdown; |
|
2
|
1
|
|
|
1
|
|
646
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
31
|
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
27
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
4
|
use Moo; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
4
|
|
|
6
|
|
|
|
|
|
|
with 'Articulate::Role::Component'; |
|
7
|
1
|
|
|
1
|
|
219
|
use Articulate::Syntax qw (instantiate); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
8
|
|
|
8
|
1
|
|
|
1
|
|
813
|
use Text::Markdown; |
|
|
1
|
|
|
|
|
14374
|
|
|
|
1
|
|
|
|
|
159
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Articulate::Augmentation::Interpreter::Markdown - convert markdown to HTML |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 METHODS |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head3 augment |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Converts markdown in the content of the response into HTML. |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=cut |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head3 markdown_parser |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
The parser which will be used. This is instantiated and defaults to L - but note that L expects a plain hash, not a reference, so it will need to be configured as an array. |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=cut |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
has markdown_parser => ( |
|
31
|
|
|
|
|
|
|
is => 'rw', |
|
32
|
|
|
|
|
|
|
lazy => 1, |
|
33
|
|
|
|
|
|
|
default => sub { |
|
34
|
|
|
|
|
|
|
'Text::Markdown'; |
|
35
|
|
|
|
|
|
|
}, |
|
36
|
|
|
|
|
|
|
coerce => sub { |
|
37
|
|
|
|
|
|
|
instantiate( $_[0] ); |
|
38
|
|
|
|
|
|
|
}, |
|
39
|
|
|
|
|
|
|
); |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub augment { |
|
42
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
|
43
|
0
|
|
|
|
|
|
my $item = shift; |
|
44
|
0
|
|
|
|
|
|
$item->content( $self->markdown_parser->markdown( $item->content ) ); |
|
45
|
0
|
|
|
|
|
|
return $item; |
|
46
|
|
|
|
|
|
|
} |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |