mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-12 12:32:21 +00:00
LibWebView: Stop tokenizing the source HTML once we hit an EOF token
This commit is contained in:
parent
26a516c85f
commit
775282f9fc
Notes:
sideshowbarker
2024-07-17 06:29:49 +09:00
Author: https://github.com/trflynn89
Commit: 775282f9fc
Pull-request: https://github.com/SerenityOS/serenity/pull/23686
Issue: https://github.com/SerenityOS/serenity/issues/23683
1 changed files with 1 additions and 1 deletions
|
@ -60,7 +60,7 @@ String highlight_source(URL::URL const& url, StringView source)
|
||||||
previous_position = end_position;
|
previous_position = end_position;
|
||||||
};
|
};
|
||||||
|
|
||||||
for (auto token = tokenizer.next_token(); token.has_value(); token = tokenizer.next_token()) {
|
for (auto token = tokenizer.next_token(); token.has_value() && !token->is_end_of_file(); token = tokenizer.next_token()) {
|
||||||
if (token->is_comment()) {
|
if (token->is_comment()) {
|
||||||
append_source(token->start_position().byte_offset);
|
append_source(token->start_position().byte_offset);
|
||||||
append_source(token->end_position().byte_offset, "comment"sv);
|
append_source(token->end_position().byte_offset, "comment"sv);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue