| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Text::Livedoor::Wiki::Plugin::Function::AName; |
|
2
|
11
|
|
|
11
|
|
60
|
use warnings; |
|
|
11
|
|
|
|
|
21
|
|
|
|
11
|
|
|
|
|
310
|
|
|
3
|
11
|
|
|
11
|
|
55
|
use strict; |
|
|
11
|
|
|
|
|
18
|
|
|
|
11
|
|
|
|
|
373
|
|
|
4
|
11
|
|
|
11
|
|
51
|
use base qw/Text::Livedoor::Wiki::Plugin::Function/; |
|
|
11
|
|
|
|
|
18
|
|
|
|
11
|
|
|
|
|
2513
|
|
|
5
|
|
|
|
|
|
|
__PACKAGE__->function_name('aname'); |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub prepare_args { |
|
8
|
4
|
|
|
4
|
1
|
5
|
my $class= shift; |
|
9
|
4
|
|
|
|
|
6
|
my $args = shift; |
|
10
|
4
|
100
|
|
|
|
30
|
die 'no arg' unless scalar @$args ; |
|
11
|
3
|
|
|
|
|
6
|
my $name = $args->[0]; |
|
12
|
|
|
|
|
|
|
# XXX is this regexp valid?? copy from old formatter |
|
13
|
3
|
100
|
|
|
|
24
|
die 'invalid format' unless $name =~ /^[a-zA-Z0-9\$\-_\.\+!\*'\(\),;\/\?:@&=]+$/; |
|
14
|
2
|
|
|
|
|
8
|
return { name => $name }; |
|
15
|
|
|
|
|
|
|
} |
|
16
|
|
|
|
|
|
|
sub process { |
|
17
|
2
|
|
|
2
|
1
|
5
|
my ( $class, $inline, $data ) = @_; |
|
18
|
2
|
|
|
|
|
4
|
my $name = $data->{args}{name}; |
|
19
|
2
|
|
|
|
|
13
|
my $value = $data->{value}; |
|
20
|
2
|
|
|
|
|
6
|
$value = $inline->parse( $value ); |
|
21
|
2
|
|
|
|
|
15
|
return qq{$value}; |
|
22
|
|
|
|
|
|
|
} |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 NAME |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
Text::Livedoor::Wiki::Plugin::Function::AName - Aname Function Plugin |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
anchor label where to jump |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
[[target>>#my_a_name]] <- jump to my_a_name anchor |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
&aname(my_a_name){a name link label} |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 FUNCTION |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head2 prepare_args |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head2 process |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 AUTHOR |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
polocky |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=cut |