Skip to content

Commit

Permalink
parser: Do not pop the stack if it doesn't contain select in scope
Browse files Browse the repository at this point in the history
  • Loading branch information
vmg committed Apr 28, 2015
1 parent 5d1f5f4 commit e450bcd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -3468,7 +3468,9 @@ static bool handle_in_select(GumboParser* parser, GumboToken* token) {
} else if (tag_is(token, kStartTag, GUMBO_TAG_SELECT)) {
parser_add_parse_error(parser, token);
ignore_token(parser);
close_current_select(parser);
if (has_an_element_in_select_scope(parser, GUMBO_TAG_SELECT)) {
close_current_select(parser);
}
return false;
} else if (tag_in(token, kStartTag, (gumbo_tagset) { TAG(INPUT), TAG(KEYGEN), TAG(TEXTAREA) })) {
parser_add_parse_error(parser, token);
Expand Down

0 comments on commit e450bcd

Please sign in to comment.