line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Markup::Mediawiki; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
63086
|
use 5.8.1; |
|
1
|
|
|
|
|
5
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
20
|
|
5
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
42
|
|
6
|
1
|
|
|
1
|
|
9
|
use File::BOM qw(open_bom); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
54
|
|
7
|
1
|
|
|
1
|
|
11
|
use Text::MediawikiFormat 1.0; |
|
1
|
|
|
|
|
14
|
|
|
1
|
|
|
|
|
8
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.25'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub parser { |
12
|
2
|
|
|
2
|
0
|
7
|
my ($file, $encoding, $opts) = @_; |
13
|
2
|
|
|
|
|
15
|
open_bom my $fh, $file, ":encoding($encoding)"; |
14
|
2
|
|
|
|
|
605
|
local $/; |
15
|
2
|
50
|
|
|
|
56
|
my $html = Text::MediawikiFormat::format(<$fh>, @{ $opts || [] }); |
|
2
|
|
|
|
|
67
|
|
16
|
2
|
100
|
|
|
|
5758
|
return unless $html =~ /\S/; |
17
|
1
|
|
|
|
|
4
|
utf8::encode($html); |
18
|
1
|
50
|
|
|
|
5
|
return $html if $opts->{raw}; |
19
|
1
|
|
|
|
|
27
|
return qq{ |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
$html |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
}; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
__END__ |