line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Trac::Pre; |
2
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
62
|
use strict; |
|
8
|
|
|
|
|
17
|
|
|
8
|
|
|
|
|
245
|
|
4
|
8
|
|
|
8
|
|
41
|
use warnings; |
|
8
|
|
|
|
|
15
|
|
|
8
|
|
|
|
|
321
|
|
5
|
8
|
|
|
8
|
|
46
|
use base qw(Text::Trac::BlockNode); |
|
8
|
|
|
|
|
19
|
|
|
8
|
|
|
|
|
41
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.23'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub init { |
10
|
120
|
|
|
120
|
0
|
660
|
my $self = shift; |
11
|
120
|
|
|
|
|
2592
|
$self->pattern(qr/^\{\{\{$/xms); |
12
|
120
|
|
|
|
|
891
|
return $self; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub parse { |
16
|
2
|
|
|
2
|
0
|
7
|
my ( $self, $l ) = @_; |
17
|
2
|
|
|
|
|
7
|
my $c = $self->{context}; |
18
|
2
|
|
|
|
|
38
|
my $pattern = $self->pattern; |
19
|
2
|
50
|
|
|
|
19
|
$l =~ /$pattern/ or return $l; |
20
|
2
|
|
|
|
|
6
|
my $match = $1; |
21
|
2
|
50
|
|
|
|
10
|
my $class = $c->{class} ? q{ class="wiki"} : ''; |
22
|
|
|
|
|
|
|
|
23
|
2
|
50
|
|
|
|
9
|
if ( $l =~ /^\{\{\{$/ ) { |
24
|
2
|
|
|
|
|
11
|
$c->htmllines(qq{}); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
2
|
|
|
|
|
10
|
while ( $c->hasnext ) { |
28
|
6
|
|
|
|
|
17
|
my $l = $c->shiftline; |
29
|
6
|
100
|
|
|
|
17
|
if ( $l =~ /^\}\}\}$/ ) { |
30
|
2
|
|
|
|
|
12
|
$c->htmllines(''); |
31
|
2
|
|
|
|
|
5
|
last; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
else { |
34
|
4
|
|
|
|
|
19
|
$c->htmllines( $self->escape($l) ); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
2
|
|
|
|
|
10
|
return; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |