line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Markup::Markdown; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
38634
|
use 5.8.1; |
|
1
|
|
|
|
|
4
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
21
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
28
|
|
6
|
1
|
|
|
1
|
|
6
|
use File::BOM qw(open_bom); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
58
|
|
7
|
1
|
|
|
1
|
|
7
|
use Text::Markdown (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
207
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.31'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub parser { |
12
|
2
|
|
|
2
|
0
|
5
|
my ($file, $encoding, $opts) = @_; |
13
|
2
|
|
|
|
|
4
|
my %params = @{ $opts }; |
|
2
|
|
|
|
|
3
|
|
14
|
2
|
|
|
|
|
14
|
my $md = Text::Markdown->new(%params); |
15
|
2
|
|
|
|
|
43
|
open_bom my $fh, $file, ":encoding($encoding)"; |
16
|
2
|
|
|
|
|
1516
|
my $html = $md->markdown(join '', <$fh>); |
17
|
2
|
100
|
|
|
|
31286
|
return unless $html =~ /\S/; |
18
|
1
|
|
|
|
|
3
|
utf8::encode($html); |
19
|
1
|
50
|
|
|
|
4
|
return $html if $params{raw}; |
20
|
1
|
|
|
|
|
34
|
return qq{ |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
$html |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
}; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
__END__ |