mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-24 18:02:20 +00:00
LibWeb: Make offset for HTML style and script elements one after
This commit is contained in:
parent
ffd5503dcb
commit
ac22e71184
Notes:
github-actions[bot]
2025-07-03 09:12:30 +00:00
Author: https://github.com/ChaseKnowlden
Commit: ac22e71184
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5148
Reviewed-by: https://github.com/AtkinsSJ ✅
1 changed files with 4 additions and 2 deletions
|
@ -68,11 +68,13 @@ void SyntaxHighlighter::rehighlight(Palette const& palette)
|
|||
if (token->tag_name() == "script"sv) {
|
||||
tokenizer.switch_to(HTMLTokenizer::State::ScriptData);
|
||||
state = State::Javascript;
|
||||
substring_start_position = { token->end_position().line, token->end_position().column };
|
||||
// The end position points to the '>' character, but we need the position after it
|
||||
substring_start_position = { token->end_position().line, token->end_position().column + 1 };
|
||||
} else if (token->tag_name() == "style"sv) {
|
||||
tokenizer.switch_to(HTMLTokenizer::State::RAWTEXT);
|
||||
state = State::CSS;
|
||||
substring_start_position = { token->end_position().line, token->end_position().column };
|
||||
// The end position points to the '>' character, but we need the position after it
|
||||
substring_start_position = { token->end_position().line, token->end_position().column + 1 };
|
||||
}
|
||||
} else if (token->is_end_tag()) {
|
||||
if (token->tag_name().is_one_of("script"sv, "style"sv)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue