diff options
author | Michael Mark <michael.mark@oit.edu> | 2024-05-22 18:55:15 -0700 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2024-05-29 12:26:22 +0100 |
commit | 20e821439e23f34bb8b614136ed33aec37961cbd (patch) | |
tree | 9383bdb6fc80f607b0dcd1be2be83708956793b1 | |
parent | 9f1f456f2f3b61d67f48e0feca2733ea14978d7d (diff) | |
download | gleam_stdlib-20e821439e23f34bb8b614136ed33aec37961cbd.tar.gz gleam_stdlib-20e821439e23f34bb8b614136ed33aec37961cbd.zip |
Escape control character (\e) handling
-rw-r--r-- | CHANGELOG.md | 4 | ||||
-rw-r--r-- | src/gleam_stdlib.erl | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index b1d2c51..fbf7a42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,8 +13,8 @@ - The `dict` module gains the `each` function. - The `list` module gains the `wrap` function. - The `iterator` module gains the `find_map` function. -- Fixed `string.inspect` not formatting `\f` (form feed), `\b` (backspace), - and `\v` (vertical tab) control characters correctly on Erlang. +- Fixed `string.inspect` not formatting the `\f` (form feed), `\b` (backspace), + `\e` (escape), and `\v` (vertical tab) control characters correctly on Erlang. - `dynamic.unsafe_coerce` function has been deprecated. - Fixed `bit_array` slices of slices sometimes being incorrect on JavaScript. - The `dict` module gains the `combine` function. diff --git a/src/gleam_stdlib.erl b/src/gleam_stdlib.erl index 3d9c5ed..cab299f 100644 --- a/src/gleam_stdlib.erl +++ b/src/gleam_stdlib.erl @@ -500,6 +500,7 @@ inspect_maybe_utf8_string(Binary, Acc) -> $\f -> <<$\\, $f>>; $\b -> <<$\\, $b>>; $\v -> <<$\\, $v>>; + $\e -> <<$\\, $e>>; Other -> <<Other/utf8>> end, inspect_maybe_utf8_string(Rest, <<Acc/binary, Escaped/binary>>); |