line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Markup::Textile; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
37381
|
use 5.8.1; |
|
1
|
|
|
|
|
4
|
|
4
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
20
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
39
|
|
6
|
1
|
|
|
1
|
|
9
|
use File::BOM qw(open_bom); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
69
|
|
7
|
1
|
|
|
1
|
|
5
|
use Text::Textile 2.10; |
|
1
|
|
|
|
|
17
|
|
|
1
|
|
|
|
|
276
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.25'; |
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
|
|
|
|
4
|
@{ $opts || [] } |
|
2
|
|
|
|
|
19
|
|
18
|
|
|
|
|
|
|
); |
19
|
2
|
|
|
|
|
424
|
open_bom my $fh, $file, ":encoding($encoding)"; |
20
|
2
|
|
|
|
|
597
|
local $/; |
21
|
2
|
|
|
|
|
58
|
my $html = $textile->process(<$fh>); |
22
|
2
|
100
|
|
|
|
4799
|
return unless $html =~ /\S/; |
23
|
1
|
|
|
|
|
5
|
utf8::encode($html); |
24
|
1
|
50
|
|
|
|
11
|
return $html if $opts->{raw}; |
25
|
1
|
|
|
|
|
62
|
return qq{ |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
$html |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
}; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
__END__ |