Subject: | Nested div elements cause contained p elements to migrate outside the div |
html of the form:
<p><div><p>foo</p></div></p>
is parsed into the tree as:
<p><div></div></p> <p>foo</p>
Versions prior to 3.23 not checked.
Subject: | noname.pl |
use strict;
use warnings;
use lib '..';
use HTML::TreeBuilder;
print "$HTML::TreeBuilder::VERSION\n";
my $html = <<'HTML';
<html>
<head>
</head>
<body>
<p><div><p>foo</p></div></p>
</body>
</html>
HTML
my $root = HTML::TreeBuilder->new;
$root->parse_content ($html);
$root->elementify ();
my @renderOptions = (undef, ' ', {});
print $root->as_HTML (@renderOptions);
# Sample output follows __DATA__
__DATA__
<html>
<head>
</head>
<body>
<p>
<div>
</div>
</p>
<p>foo</p>
</body>
</html>