mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-25 10:48:53 +00:00
LibJS: Fix that a windows-style new line was not escaped properly
This commit is contained in:
parent
ba622cffe4
commit
4cc95ae39d
Notes:
sideshowbarker
2024-07-18 05:37:23 +09:00
Author: https://github.com/davidot
Commit: 4cc95ae39d
Pull-request: https://github.com/SerenityOS/serenity/pull/9085
Reviewed-by: https://github.com/IdanHo
Reviewed-by: https://github.com/linusg ✅
Reviewed-by: https://github.com/trflynn89
1 changed files with 3 additions and 0 deletions
|
@ -549,6 +549,9 @@ Token Lexer::next()
|
|||
while (m_current_char != stop_char && m_current_char != '\r' && m_current_char != '\n' && !is_eof()) {
|
||||
if (m_current_char == '\\') {
|
||||
consume();
|
||||
if (m_current_char == '\r' && m_position < m_source.length() && m_source[m_position] == '\n') {
|
||||
consume();
|
||||
}
|
||||
}
|
||||
consume();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue