Subject: | HTML::TreeBuilder with implicit_body_p_tag() on <br /> |
use HTML::TreeBuilder;
my $html = "<br />";
my $root = HTML::TreeBuilder->new();
$root->implicit_body_p_tag(1);
$root->xml_mode(1);
$root->parse($html);
$root->eof();
print $root->as_HTML(), "\n";
----
Output: "<html><head></head><body><p><br /></body></html>"
Desired: "<html><head></head><body><br /></body></html>"
Note: this only crops up with the combination of xml_mode and
implicit_body_p_tag.
I don't think it should place implicit paras around a <br />. I'm trying
to write an auto-enpara script. I'm breaking user submissions on ~ \n\n
and then treebuilding each block to either auto-enpara, leave alone if
it's already a block, or do more parsing. A naked <br />, I think,
should not get a para.
Thank you for considering it -- all you guys rule.
-Ashley