line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Livedoor::Wiki::Plugin::Block::Pre; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
30
|
use warnings; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
210
|
|
4
|
5
|
|
|
5
|
|
27
|
use strict; |
|
5
|
|
|
|
|
19
|
|
|
5
|
|
|
|
|
160
|
|
5
|
5
|
|
|
5
|
|
26
|
use base qw(Text::Livedoor::Wiki::Plugin::Block); |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
593
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub check { |
8
|
144
|
|
|
144
|
1
|
452
|
my $self = shift; |
9
|
144
|
|
|
|
|
404
|
my $line = shift; |
10
|
144
|
|
|
|
|
229
|
my $args = shift; |
11
|
144
|
|
|
|
|
261
|
my $on_next = $args->{on_next}; |
12
|
|
|
|
|
|
|
|
13
|
144
|
100
|
|
|
|
435
|
if( $line =~ /^\^/ ) { |
14
|
9
|
100
|
|
|
|
33
|
$line =~ s/^\^// unless $on_next;; |
15
|
9
|
|
|
|
|
55
|
return { line => $line . "\n" }; |
16
|
|
|
|
|
|
|
} |
17
|
135
|
|
|
|
|
760
|
return; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub get { |
22
|
3
|
|
|
3
|
1
|
8
|
my $self = shift; |
23
|
3
|
|
|
|
|
6
|
my $block = shift; |
24
|
3
|
|
|
|
|
6
|
my $inline = shift; |
25
|
3
|
|
|
|
|
5
|
my $items = shift; |
26
|
3
|
|
|
|
|
7
|
my $html = ''; |
27
|
3
|
|
|
|
|
16
|
$html .= $inline->parse( $_->{line} ) . "\n" for @$items; |
28
|
3
|
|
|
|
|
16
|
return "\n$html \n"; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 NAME |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Text::Livedoor::Wiki::Plugin::Block::Pre - Pre Block Plugin |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 DESCRIPTION |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
pre-formatted text |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 SYNOPSIS |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
^ PRE |
44
|
|
|
|
|
|
|
^ pre block |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 FUNCTION |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head2 check |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head2 get |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 AUTHOR |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
polocky |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=cut |