line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Livedoor::Wiki::Plugin::Inline::WikiPage; |
2
|
|
|
|
|
|
|
|
3
|
10
|
|
|
10
|
|
54
|
use warnings; |
|
10
|
|
|
|
|
21
|
|
|
10
|
|
|
|
|
301
|
|
4
|
10
|
|
|
10
|
|
49
|
use strict; |
|
10
|
|
|
|
|
18
|
|
|
10
|
|
|
|
|
288
|
|
5
|
10
|
|
|
10
|
|
50
|
use base qw(Text::Livedoor::Wiki::Plugin::Inline); |
|
10
|
|
|
|
|
17
|
|
|
10
|
|
|
|
|
252
|
|
6
|
10
|
|
|
10
|
|
667
|
use Text::Livedoor::Wiki::Utils; |
|
10
|
|
|
|
|
18
|
|
|
10
|
|
|
|
|
112
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
__PACKAGE__->regex(q{\[\[((?:[^>\]]+>{1,3})?)([^\]]+)\]\]}); |
9
|
|
|
|
|
|
|
__PACKAGE__->n_args(2); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub process { |
12
|
4
|
|
|
4
|
1
|
9
|
my ( $class , $inline , $label , $pagename ) = @_; |
13
|
4
|
100
|
|
|
|
10
|
if( $label ) { |
14
|
2
|
|
|
|
|
11
|
$label =~ s/>$//; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
else { |
17
|
2
|
|
|
|
|
4
|
$label = $pagename; |
18
|
|
|
|
|
|
|
} |
19
|
4
|
|
|
|
|
15
|
$label = Text::Livedoor::Wiki::Utils::escape( $label ); |
20
|
4
|
100
|
|
|
|
19
|
if ( $pagename =~ /^(http|https|ftp):\/\// ) { |
21
|
2
|
|
|
|
|
8
|
my $url = Text::Livedoor::Wiki::Utils::escape($pagename); |
22
|
2
|
|
|
|
|
14
|
return qq|$label|; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
else { |
25
|
2
|
|
|
|
|
10
|
$pagename = Text::Livedoor::Wiki::Utils::sanitize_uri($pagename); |
26
|
2
|
|
50
|
|
|
17
|
my $base_url = $class->opts->{inline_wikipage_base_url} || '/'; |
27
|
2
|
|
|
|
|
14
|
return qq|$label|; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 NAME |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Text::Livedoor::Wiki::Plugin::Inline::WikiPage - wikipage link Inline Plugin |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 DESCRIPTION |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
wikipage link. do start with http:// ;-p |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 SYNOPSIS |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
[[PageName]] |
44
|
|
|
|
|
|
|
[[Page Name Label>PageName]] |
45
|
|
|
|
|
|
|
[[livedoor wiki>http://wiki.livedoor.com]] |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 opts |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head2 inline_wikipage_base_url |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
you can set base URL |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 FUNCTION |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head2 process |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 AUTHOR |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
polocky |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=cut |