Skip to content

Commit

Permalink
col element has no end tag
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Sep 17, 2013
1 parent 0ffffb2 commit cf95187
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Mojo/DOM/HTML.pm
Expand Up @@ -56,7 +56,7 @@ my %PARAGRAPH = map { $_ => 1 } (
);

# HTML table elements with optional end tags
my %TABLE = map { $_ => 1 } qw(col colgroup tbody td tfoot th thead tr);
my %TABLE = map { $_ => 1 } qw(colgroup tbody td tfoot th thead tr);

# HTML elements without end tags
my %VOID = map { $_ => 1 } (
Expand Down Expand Up @@ -150,11 +150,11 @@ sub parse {
sub render { $_[0]->_render($_[0]->tree) }

sub _close {
my ($self, $current, $allowed, $target) = @_;
my ($self, $current, $allowed, $scope) = @_;

# Close allowed parent elements until reaching target tag
# Close allowed parent elements in scope
my $parent = $$current;
while ($parent->[0] ne 'root' && $parent->[1] ne $target) {
while ($parent->[0] ne 'root' && $parent->[1] ne $scope) {
$self->_end($parent->[1], $current) if $allowed->{$parent->[1]};
$parent = $parent->[3];
}
Expand Down

0 comments on commit cf95187

Please sign in to comment.