line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Template::Pro::Extension::TAG_ATTRIBUTE_NORMALIZER; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
$VERSION = "0.11"; |
4
|
0
|
|
|
0
|
0
|
0
|
sub Version { $VERSION; } |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
4
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
48
|
|
7
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
264
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my %fields_parent = |
10
|
|
|
|
|
|
|
( |
11
|
|
|
|
|
|
|
); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub init { |
14
|
1
|
|
|
1
|
0
|
1
|
my $self = shift; |
15
|
1
|
|
|
|
|
6
|
while (my ($key,$val) = each(%fields_parent)) { |
16
|
0
|
|
0
|
|
|
0
|
$self->{$key} = $self->{$key} || $val; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub get_filter { |
21
|
1
|
|
|
1
|
0
|
2
|
my $self = shift; |
22
|
1
|
|
|
|
|
2
|
return _get_filter($self); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
sub _get_filter { |
25
|
1
|
|
|
1
|
|
1
|
my $self = shift; |
26
|
1
|
|
|
|
|
2
|
my @ret ; |
27
|
1
|
|
|
|
|
2
|
push @ret,\&_tag_attribute_normalizer; |
28
|
1
|
|
|
|
|
4
|
return @ret; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub _tag_attribute_normalizer { |
33
|
1
|
|
|
1
|
|
1
|
my $template = shift; |
34
|
1
|
|
|
|
|
5
|
$$template =~ s/(< |
35
|
|
|
|
|
|
|
(?:!--\s*)? |
36
|
|
|
|
|
|
|
(?: |
37
|
|
|
|
|
|
|
[Tt][Mm][Pp][Ll]_ |
38
|
|
|
|
|
|
|
(?: |
39
|
|
|
|
|
|
|
(?:[Vv][Aa][Rr]) |
40
|
|
|
|
|
|
|
| |
41
|
|
|
|
|
|
|
(?:[Ll][Oo][Oo][Pp]) |
42
|
|
|
|
|
|
|
| |
43
|
|
|
|
|
|
|
(?:[Ii][Ff]) |
44
|
|
|
|
|
|
|
| |
45
|
|
|
|
|
|
|
(?:[Ee][Ll][Ss][Ee]) |
46
|
|
|
|
|
|
|
| |
47
|
|
|
|
|
|
|
(?:[Uu][Nn][Ll][Ee][Ss][Ss]) |
48
|
|
|
|
|
|
|
| |
49
|
|
|
|
|
|
|
(?:[Ii][Nn][Cc][Ll][Uu][Dd][Ee]) |
50
|
|
|
|
|
|
|
) |
51
|
|
|
|
|
|
|
) |
52
|
|
|
|
|
|
|
)(.*?) |
53
|
|
|
|
|
|
|
[Cc][Ll][Aa][Ss][Ss]\s*=\s*(?:.*?)" |
54
|
|
|
|
|
|
|
\s* |
55
|
|
|
|
|
|
|
((?:--)?>)/$1$2$3$4/sxg; |
56
|
|
|
|
|
|
|
#open(DEBUG,'>/tmp/debug.txt'); |
57
|
|
|
|
|
|
|
#print DEBUG $$template; |
58
|
|
|
|
|
|
|
#close(DEBUG); |
59
|
1
|
|
|
|
|
5
|
return $$template; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
# vim: set ts=2: |