mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
LibWeb: Fix tokenization of attributes with URL query strings in them
<a href="/foo&=bar"> was being tokenized into <a href="/foo&=bar">. The spec mentions this but I had overlooked it. The bug happens because we interpreted the "&" as a named character reference.
This commit is contained in:
parent
6400122760
commit
c33d17d363
Notes:
sideshowbarker
2024-07-19 05:25:49 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/c33d17d363c
1 changed files with 8 additions and 0 deletions
|
@ -1458,6 +1458,14 @@ _StartOfFunction:
|
|||
for (auto ch : match.value().entity)
|
||||
m_temporary_buffer.append(ch);
|
||||
|
||||
if (consumed_as_part_of_an_attribute() && match.value().codepoints.last() != ';') {
|
||||
auto next = peek_codepoint(0);
|
||||
if (next.has_value() && (next.value() == '=' || isalnum(next.value()))) {
|
||||
FLUSH_CODEPOINTS_CONSUMED_AS_A_CHARACTER_REFERENCE;
|
||||
SWITCH_TO_RETURN_STATE;
|
||||
}
|
||||
}
|
||||
|
||||
if (consumed_as_part_of_an_attribute() && match.value().entity.ends_with(';')) {
|
||||
auto next_codepoint = peek_codepoint(0);
|
||||
if (next_codepoint.has_value() && next_codepoint.value() == '=') {
|
||||
|
|
Loading…
Add table
Reference in a new issue