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