Created
October 26, 2009 10:04
-
-
Save kyanny/218540 to your computer and use it in GitHub Desktop.
implicit() implicit_tags()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use HTML::TreeBuilder; | |
use Test::Base; | |
plan tests => 1 * blocks; | |
run_is input => 'expected'; | |
sub html_tree_parse { | |
my $tree = HTML::TreeBuilder->new(); | |
$tree->implicit(0); # これはちょっと違う気がする | |
$tree->implicit_tags(0); # これを false にすればいいんだと思うんだがなぁ... | |
$tree->parse($_); | |
$tree->eof(); | |
return $tree->as_HTML(''); | |
} | |
__END__ | |
=== | |
--- input html_tree_parse | |
<div> | |
<p>foo bar baz</p> | |
<div class="blah"> | |
<p>blah blah blah</p> | |
</div> | |
</div> | |
--- expected | |
<div><p>foo bar baz<div class="blah"><p>blah blah blah</div></div> | |
--- LAST |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment