From fd235d8a06b80a09ed0af8002d86b141171f8ef1 Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Sat, 19 Mar 2022 20:15:28 +0100 Subject: [PATCH] LibWeb: Don't put a backslash after escape sequences in text-like tokens Previously, a string token like '\41' would be tokenized to 'A\'. This could be seen on Wikipedia headlines. --- Userland/Libraries/LibWeb/CSS/Parser/Tokenizer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Tokenizer.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Tokenizer.cpp index 381586fb48..fc01e34805 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Tokenizer.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Tokenizer.cpp @@ -761,6 +761,7 @@ Token Tokenizer::consume_a_url_token() if (is_valid_escape_sequence(start_of_input_stream_twin())) { // consume an escaped code point and append the returned code point to the ’s value. builder.append_code_point(consume_escaped_code_point()); + continue; } else { // Otherwise, this is a parse error. log_parse_error(); @@ -1037,6 +1038,7 @@ Token Tokenizer::consume_string_token(u32 ending_code_point) // point and append the returned code point to the ’s value. auto escaped = consume_escaped_code_point(); builder.append_code_point(escaped); + continue; } // anything else