line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#$Id: Markdown.pm,v 1.3 2005/11/12 03:28:09 naoya Exp $ |
2
|
|
|
|
|
|
|
package Template::Plugin::Markdown; |
3
|
2
|
|
|
2
|
|
126016
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
100
|
|
4
|
2
|
|
|
2
|
|
12
|
use base qw (Template::Plugin::Filter); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
2166
|
|
5
|
2
|
|
|
2
|
|
14386
|
use Text::Markdown; |
|
2
|
|
|
|
|
131460
|
|
|
2
|
|
|
|
|
396
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = 0.02; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub init { |
10
|
2
|
|
|
2
|
0
|
6121
|
my $self = shift; |
11
|
2
|
|
|
|
|
19
|
$self->{_DYNAMIC} = 1; |
12
|
2
|
|
50
|
|
|
27
|
$self->install_filter($self->{_ARGS}->[0] || 'markdown'); |
13
|
2
|
|
|
|
|
104
|
$self; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub filter { |
17
|
2
|
|
|
2
|
0
|
192
|
my ($self, $text, $args, $config) = @_; |
18
|
2
|
|
|
|
|
11
|
my $m = Text::Markdown->new; |
19
|
2
|
|
|
|
|
45
|
return $m->markdown($text); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
1; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
__END__ |