mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 03:55:24 +00:00
GMLCompiler: Fix bug where backslash in escaped sequence was preserved
This commit is contained in:
parent
6265c544f9
commit
a4e272d2c8
Notes:
sideshowbarker
2024-07-17 10:31:19 +09:00
Author: https://github.com/bplaat Commit: https://github.com/SerenityOS/serenity/commit/a4e272d2c8 Pull-request: https://github.com/SerenityOS/serenity/pull/21098 Reviewed-by: https://github.com/ADKaster ✅
1 changed files with 1 additions and 1 deletions
|
@ -145,10 +145,10 @@ static ErrorOr<String> escape_string(JsonValue to_escape)
|
|||
// All C++ simple escape sequences; see https://en.cppreference.com/w/cpp/language/escape
|
||||
// Other commonly-escaped characters are hard-to-type Unicode and therefore fine to include verbatim in UTF-8 coded strings.
|
||||
static HashMap<StringView, StringView> escape_sequences = {
|
||||
{ "\\"sv, "\\\\"sv }, // This needs to be the first because otherwise the the backslashes of other items will be double escaped
|
||||
{ "\0"sv, "\\0"sv },
|
||||
{ "\'"sv, "\\'"sv },
|
||||
{ "\""sv, "\\\""sv },
|
||||
{ "\\"sv, "\\\\"sv },
|
||||
{ "\a"sv, "\\a"sv },
|
||||
{ "\b"sv, "\\b"sv },
|
||||
{ "\f"sv, "\\f"sv },
|
||||
|
|
Loading…
Add table
Reference in a new issue