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