From 20e7be7d5461cbc43b87ed18041074959aae4522 Mon Sep 17 00:00:00 2001 From: Kevin Hendricks Date: Sat, 8 Apr 2023 11:24:59 -0400 Subject: [PATCH] correctly handle text in form elements ala nokogirl commit 73c5df2 --- src/parser.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/parser.c b/src/parser.c index 5ceda8e..2096f4c 100644 --- a/src/parser.c +++ b/src/parser.c @@ -2986,6 +2986,9 @@ static bool handle_in_body(GumboParser* parser, GumboToken* token) { ignore_token(parser); return false; } + // Since we remove the form node without popping, we need to make sure + // that we flush any text nodes at the end of the form + maybe_flush_text_node_buffer(parser); // This differs from implicitly_close_tags because we remove *only* the //
element; other nodes are left in scope. generate_implied_end_tags(parser, GUMBO_TAG_LAST);