line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Markup::Textile; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
37718
|
use 5.8.1; |
|
1
|
|
|
|
|
4
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
5
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
30
|
|
6
|
1
|
|
|
1
|
|
10
|
use File::BOM qw(open_bom); |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
51
|
|
7
|
1
|
|
|
1
|
|
11
|
use Text::Textile 2.10; |
|
1
|
|
|
|
|
15
|
|
|
1
|
|
|
|
|
218
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.30'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub parser { |
12
|
2
|
|
|
2
|
0
|
9
|
my ($file, $encoding, $opts) = @_; |
13
|
|
|
|
|
|
|
my $textile = Text::Textile->new( |
14
|
|
|
|
|
|
|
charset => 'utf-8', |
15
|
|
|
|
|
|
|
char_encoding => 0, |
16
|
|
|
|
|
|
|
trim_spaces => 1, |
17
|
2
|
50
|
|
|
|
7
|
@{ $opts || [] } |
|
2
|
|
|
|
|
19
|
|
18
|
|
|
|
|
|
|
); |
19
|
2
|
|
|
|
|
391
|
open_bom my $fh, $file, ":encoding($encoding)"; |
20
|
2
|
|
|
|
|
560
|
local $/; |
21
|
2
|
|
|
|
|
63
|
my $html = $textile->process(<$fh>); |
22
|
2
|
100
|
|
|
|
4608
|
return unless $html =~ /\S/; |
23
|
1
|
|
|
|
|
3
|
utf8::encode($html); |
24
|
1
|
50
|
|
|
|
11
|
return $html if $opts->{raw}; |
25
|
1
|
|
|
|
|
63
|
return qq{ |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
$html |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
}; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
__END__ |