diff -rup a/lib/HTML/DOM/_TreeBuilder.pm b/lib/HTML/DOM/_TreeBuilder.pm
--- HTML-Tree-4.2-SxenFd-orig/lib/HTML/TreeBuilder.pm 2011-04-06 01:37:54.000000000 -0700
+++ HTML-Tree-4.2-SxenFd/lib/HTML/TreeBuilder.pm 2012-03-24 14:29:11.000000000 -0700
@@ -706,7 +706,8 @@ sub warning {
for ( keys %$attr ) {
$body->attr( $_, $attr->{$_} );
}
- return $self->{'_pos'} = $body; # bypass tweaking.
+ $self->{'_pos'} = $body unless $pos->is_inside('body');
+ return $self->{'_pos'}; # bypass tweaking.
#----------------------------------------------------------------------
}