| 15 |
|
|
| 16 |
if ($mode eq '/html' or $mode eq '/test') { |
if ($mode eq '/html' or $mode eq '/test') { |
| 17 |
require Encode; |
require Encode; |
| 18 |
require What::HTML; |
require Whatpm::HTML; |
| 19 |
require What::NanoDOM; |
require Whatpm::NanoDOM; |
| 20 |
|
|
| 21 |
my $s = $http->parameter ('s'); |
my $s = $http->parameter ('s'); |
| 22 |
if (length $s > 1000_000) { |
if (length $s > 1000_000) { |
| 34 |
print STDOUT "0,0,", $_[0], "\n"; |
print STDOUT "0,0,", $_[0], "\n"; |
| 35 |
}; |
}; |
| 36 |
|
|
| 37 |
my $doc = What::HTML->parse_string |
my $doc = Whatpm::HTML->parse_string |
| 38 |
($s => What::NanoDOM::Document->new, $onerror); |
($s => Whatpm::NanoDOM::Document->new, $onerror); |
| 39 |
|
|
| 40 |
print "#document\n"; |
print "#document\n"; |
| 41 |
|
|
| 42 |
my $out; |
my $out; |
| 43 |
if ($mode eq '/html') { |
if ($mode eq '/html') { |
| 44 |
$out = What::HTML->get_inner_html ($doc); |
$out = Whatpm::HTML->get_inner_html ($doc); |
| 45 |
} else { # test |
} else { # test |
| 46 |
$out = test_serialize ($doc); |
$out = test_serialize ($doc); |
| 47 |
} |
} |