line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::AsSubs; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: functions that construct a HTML syntax tree |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
12902
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
7
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
199
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '5.910'; # TRIAL VERSION from OurPkgVersion |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
require HTML::Element; |
12
|
|
|
|
|
|
|
require Exporter; |
13
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# Problem: exports so damned much. Has no concept of "export only HTML4 |
16
|
|
|
|
|
|
|
# elements". TODO:?? make something that make functions that just |
17
|
|
|
|
|
|
|
# wrap XML::Generator calls? |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
our @TAGS = qw(html |
21
|
|
|
|
|
|
|
head title base link meta isindex nextid script style |
22
|
|
|
|
|
|
|
body h1 h2 h3 h4 h5 h6 p pre div blockquote |
23
|
|
|
|
|
|
|
a img br hr |
24
|
|
|
|
|
|
|
ol ul dir menu li |
25
|
|
|
|
|
|
|
dl dt dd |
26
|
|
|
|
|
|
|
dfn cite code em kbd samp strong var address span |
27
|
|
|
|
|
|
|
b i u tt |
28
|
|
|
|
|
|
|
center font big small strike |
29
|
|
|
|
|
|
|
sub sup |
30
|
|
|
|
|
|
|
table tr td th caption |
31
|
|
|
|
|
|
|
form input select option textarea |
32
|
|
|
|
|
|
|
object applet param |
33
|
|
|
|
|
|
|
map area |
34
|
|
|
|
|
|
|
frame frameset noframe |
35
|
|
|
|
|
|
|
); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
our @EXPORT; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
for (@TAGS) { |
40
|
|
|
|
|
|
|
my $code; |
41
|
|
|
|
|
|
|
$code = "sub $_ { _elem('$_', \@_); }\n"; |
42
|
|
|
|
|
|
|
push( @EXPORT, $_ ); |
43
|
|
|
|
|
|
|
## no critic |
44
|
4
|
|
|
4
|
1
|
2242
|
eval $code; |
|
1
|
|
|
1
|
1
|
578
|
|
|
1
|
|
|
1
|
1
|
583
|
|
|
1
|
|
|
1
|
1
|
575
|
|
|
1
|
|
|
1
|
1
|
572
|
|
|
1
|
|
|
1
|
1
|
574
|
|
|
1
|
|
|
1
|
1
|
573
|
|
|
1
|
|
|
1
|
1
|
591
|
|
|
1
|
|
|
1
|
1
|
577
|
|
|
1
|
|
|
1
|
1
|
583
|
|
|
1
|
|
|
1
|
1
|
565
|
|
|
1
|
|
|
1
|
1
|
570
|
|
|
1
|
|
|
1
|
1
|
573
|
|
|
1
|
|
|
1
|
1
|
608
|
|
|
1
|
|
|
1
|
1
|
565
|
|
|
1
|
|
|
1
|
1
|
587
|
|
|
1
|
|
|
1
|
1
|
573
|
|
|
1
|
|
|
1
|
1
|
571
|
|
|
1
|
|
|
1
|
1
|
567
|
|
|
1
|
|
|
1
|
1
|
606
|
|
|
1
|
|
|
1
|
1
|
568
|
|
|
1
|
|
|
1
|
1
|
569
|
|
|
1
|
|
|
1
|
1
|
576
|
|
|
1
|
|
|
1
|
1
|
592
|
|
|
1
|
|
|
1
|
1
|
563
|
|
|
1
|
|
|
1
|
1
|
568
|
|
|
1
|
|
|
1
|
1
|
592
|
|
|
1
|
|
|
1
|
1
|
568
|
|
|
1
|
|
|
1
|
1
|
601
|
|
|
1
|
|
|
1
|
1
|
566
|
|
|
1
|
|
|
1
|
1
|
594
|
|
|
1
|
|
|
1
|
1
|
811
|
|
|
1
|
|
|
1
|
1
|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
|
} |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub _elem { |
53
|
75
|
|
|
75
|
|
188
|
my $tag = shift; |
54
|
75
|
|
|
|
|
116
|
my $attributes; |
55
|
75
|
100
|
100
|
|
|
521
|
if ( @_ and defined $_[0] and ref( $_[0] ) eq "HASH" ) { |
|
|
|
100
|
|
|
|
|
56
|
1
|
|
|
|
|
2
|
$attributes = shift; |
57
|
|
|
|
|
|
|
} |
58
|
75
|
|
|
|
|
320
|
my $elem = HTML::Element->new( $tag, %$attributes ); |
59
|
75
|
|
|
|
|
244
|
$elem->push_content(@_); |
60
|
75
|
|
|
|
|
522
|
$elem; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
__END__ |