line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Articulate::Augmentation::Interpreter::Markdown;
|
2
|
1
|
|
|
1
|
|
881
|
use strict;
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
32
|
|
3
|
1
|
|
|
1
|
|
3
|
use warnings;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
18
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
4
|
use Moo;
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
6
|
|
|
|
|
|
|
with 'Articulate::Role::Component';
|
7
|
1
|
|
|
1
|
|
308
|
use Articulate::Syntax qw (instantiate);
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
36
|
|
8
|
1
|
|
|
1
|
|
844
|
use Text::Markdown;
|
|
1
|
|
|
|
|
26017
|
|
|
1
|
|
|
|
|
250
|
|
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 (
|
45
|
|
|
|
|
|
|
$self->markdown_parser->markdown($item->content)
|
46
|
|
|
|
|
|
|
);
|
47
|
0
|
|
|
|
|
|
return $item;
|
48
|
|
|
|
|
|
|
}
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1;
|