line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Plugin::Nbsp; |
2
|
|
|
|
|
|
|
$VERSION = 0.01; |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
62394
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
37
|
|
5
|
1
|
|
|
1
|
|
5
|
use base 'Template::Plugin'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
1000
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new { |
8
|
4
|
|
|
4
|
1
|
21489
|
my ($self, $context) = @_; |
9
|
|
|
|
|
|
|
|
10
|
4
|
|
|
|
|
20
|
$context->define_filter('nbsp', \ , ''); |
11
|
|
|
|
|
|
|
|
12
|
4
|
|
|
|
|
78
|
return $self; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub nbsp { |
16
|
4
|
|
|
4
|
0
|
220
|
my $text = shift; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# undef? |
19
|
4
|
50
|
|
|
|
16
|
return ' ' unless defined $text; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# empty string? |
22
|
4
|
100
|
|
|
|
13
|
return ' ' if ($text eq ''); |
23
|
|
|
|
|
|
|
|
24
|
2
|
|
|
|
|
5
|
return $text; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
__END__ |