line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package YAPE::HTML; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
3587
|
use YAPE::HTML::Element; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
4
|
1
|
|
|
1
|
|
7
|
use Carp; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
134
|
|
5
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
50
|
|
6
|
1
|
|
|
1
|
|
6
|
use vars qw( $VERSION %OPEN %EMPTY %SSI ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1064
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
$VERSION = '1.11'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# when tags get added here, update the POD |
12
|
|
|
|
|
|
|
my @empty = qw( area base br hr img input link meta param ); |
13
|
|
|
|
|
|
|
my @open = qw( dd dt li p ); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
@OPEN{@empty, @open} = (); |
17
|
1
|
|
|
1
|
|
18
|
sub OPEN { @OPEN{map lc, @_} = () } |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
@EMPTY{@empty} = (); |
21
|
2
|
|
|
2
|
1
|
45
|
sub EMPTY { @OPEN{map lc, @_} = @EMPTY{map lc, @_} = () } |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# "CGI Programming with Perl", Ch. 6, "Server Side Includes" (O'Reilly) |
25
|
|
|
|
|
|
|
%SSI = ( |
26
|
|
|
|
|
|
|
config => { map +($_,1), qw( errmsg sizefmt timefmt ) }, |
27
|
|
|
|
|
|
|
echo => { map +($_,1), qw( var ) }, |
28
|
|
|
|
|
|
|
elif => { map +($_,1), qw( expr ) }, |
29
|
|
|
|
|
|
|
else => {}, |
30
|
|
|
|
|
|
|
endif => {}, |
31
|
|
|
|
|
|
|
exec => { map +($_,1), qw( cgi cmd ) }, |
32
|
|
|
|
|
|
|
flastmod => { map +($_,1), qw( file ) }, |
33
|
|
|
|
|
|
|
fsize => { map +($_,1), qw( file virtual ) }, |
34
|
|
|
|
|
|
|
if => { map +($_,1), qw( expr ) }, |
35
|
|
|
|
|
|
|
include => { map +($_,1), qw( file virtual ) }, |
36
|
|
|
|
|
|
|
printenv => {}, |
37
|
|
|
|
|
|
|
set => { map +($_,1), qw( var ) }, |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
my %pat = ( |
42
|
|
|
|
|
|
|
# incomplete DTD support -- add to future version |
43
|
|
|
|
|
|
|
DTD => qr{
|
44
|
|
|
|
|
|
|
DTD_attr => qr{ \s+ ( "[^"]*" | '[^']*' | [^\s>]* ) }x, |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# incomplete PI support -- add to future version |
47
|
|
|
|
|
|
|
PI => qr{ <\? (\S+) }x, |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
SSI => qr{ |