I am trying to modify HTML using TreeBuilder but in the output of as_HTML I am getting some additional tags that are not present in input file. I want input HTML as it is except when I modify it. Current code shows how TreeBuilder is modifying input HTML. Can anyone suggest me any option to avoid input HTML modification except when explicitly done by me
use HTML::TreeBuilder;
my $row_html = '<!DOCTYPE html>
<body>
<p>test https://www.google.com</p>
</body>';
my $html = HTML::TreeBuilder->new;
$html->ignore_ignorable_whitespace(0);
$html->no_space_compacting(1);
$html->store_comments(1);
$html->parse($row_html);
# i will do some modifications to HTML here
my $output_html = $html->as_HTML(undef,undef,{});
print $output_html;
Current Output with HTML and HEAD tags added by TreeBuilder :
<!DOCTYPE html>
<html><head></head><body>
<p>test https://www.google.com</p>
</body>
</html>
I was expecting following output (same as input as im not changing anything in HTML as of now) :
<!DOCTYPE html>
<body>
<p>test https://www.google.com</p>
</body>