6 use Test::More tests => 2;
11 my($event, $tagname, $text) = @_;
12 for ($event, $tagname, $text) {
14 s/([\n\r\t])/sprintf "\\%03o", ord($1)/ge;
21 $TEXT .= "[$event,$tagname,$text]\n";
24 my $p = HTML::Parser->new(default_h => [\&h, "event,tagname,text"]);
27 $p->parse("</a 'foo<>' 'bar>' x>");
28 $p->parse("</a \"foo<>\"");
29 $p->parse(" \"bar>\" x>");
30 $p->parse("</ foo bar>");
31 $p->parse("</ \"<>\" >");
32 $p->parse("<!--comment>text<!--comment><p");
36 [start_document,<undef>,]
39 [end,a,</a 'foo<>' 'bar>' x>]
40 [end,a,</a "foo<>" "bar>" x>]
41 [comment, foo bar,</ foo bar>]
42 [comment, "<>" ,</ "<>" >]
43 [comment,comment,<!--comment>]
45 [comment,comment,<!--comment>]
47 [end_document,<undef>,]
51 $p->parse("<!comment>");
55 [start_document,<undef>,]
56 [comment,comment,<!comment>]
57 [end_document,<undef>,]