mirror of
https://github.com/RGBCube/serenity
synced 2025-07-07 16:37:34 +00:00
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.
This commit is contained in:
parent
ff3256792d
commit
fd235d8a06
1 changed files with 2 additions and 0 deletions
|
@ -761,6 +761,7 @@ Token Tokenizer::consume_a_url_token()
|
||||||
if (is_valid_escape_sequence(start_of_input_stream_twin())) {
|
if (is_valid_escape_sequence(start_of_input_stream_twin())) {
|
||||||
// consume an escaped code point and append the returned code point to the <url-token>’s value.
|
// consume an escaped code point and append the returned code point to the <url-token>’s value.
|
||||||
builder.append_code_point(consume_escaped_code_point());
|
builder.append_code_point(consume_escaped_code_point());
|
||||||
|
continue;
|
||||||
} else {
|
} else {
|
||||||
// Otherwise, this is a parse error.
|
// Otherwise, this is a parse error.
|
||||||
log_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 <string-token>’s value.
|
// point and append the returned code point to the <string-token>’s value.
|
||||||
auto escaped = consume_escaped_code_point();
|
auto escaped = consume_escaped_code_point();
|
||||||
builder.append_code_point(escaped);
|
builder.append_code_point(escaped);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// anything else
|
// anything else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue