1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
## skip Test::Tabs
use Test::More tests => 3;
use HTML::HTML5::Parser;
my $parser = HTML::HTML5::Parser->new;
my $html = <<HTML;
<!doctype html public "+//IDN demiblog.org//Foo Bar//EN">
<title>foo</title>
<p x="quux">Foo
<ul xmlns:foo="http://example.com/"><li><b><i>Bar</b>t<</i>
The inequality is 2<3 .<br>
<!--Hello-World --!></ul>
<body a="b"><p>Baz<p///></br>
<table>
<caption>CCC</CAPTION>
<p>HHH</p>
<tr><td>
</table>
HTML
ok(my $dom = $parser->parse_string($html), "parse_string works");
is($parser->dtd_public_id($dom), "+//IDN demiblog.org//Foo Bar//EN", "dtd_public_id works");
my @italics = $dom->getElementsByTagName('i');
my $lone_letter = $italics[1];
is($lone_letter->textContent, 't<', "parsing seems to follow HTML5 rules");
=head1 PURPOSE
Test basic functionality.
=head1 AUTHOR
Toby Inkster, E<lt>tobyink@cpan.orgE<gt>
=head1 COPYRIGHT AND LICENCE
Copyright (C) 2012 by Toby Inkster
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
|