print "1..1\n"; use strict; use HTML::Parser; my $html = <<'EOT';
EOT my $dump = ""; sub tdump { my @a = @_; for (@a) { $_ = "" unless defined; s/\n/\\n/g; } $dump .= join("|", @a) . "\n"; } my $p = HTML::Parser->new(default_h => [\&tdump, "event,text,is_cdata"]); $p->parse($html)->eof; #print $dump; print "not " unless $dump eq <<'EOT'; print "ok 1\n"; start_document|| start|| text|\n| comment|| text|\n| start|| text|\n\n| start|
| text|\n\n| start|| text|\n\n| end|| text|\n\n| end|| text|\n| end_document|| EOT