mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +00:00
LibWebView: Stop tokenizing the source HTML once we hit an EOF token
This commit is contained in:
committed by
Andreas Kling
parent
26a516c85f
commit
775282f9fc
@@ -60,7 +60,7 @@ String highlight_source(URL::URL const& url, StringView source)
|
||||
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()) {
|
||||
append_source(token->start_position().byte_offset);
|
||||
append_source(token->end_position().byte_offset, "comment"sv);
|
||||
|
||||
Reference in New Issue
Block a user