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