From 6f665c1dd2b3a9d005a62dbaab65df0a3a381111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Mon, 11 Dec 2023 13:47:33 -0800 Subject: [PATCH] Escape unprintable 0x7F (delete control character) (#2144) Co-authored-by: Natalie Weizenbaum --- CHANGELOG.md | 2 ++ lib/src/visitor/serialize.dart | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31b33c809..a4995a0cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ * Produce better output for numbers with complex units in `meta.inspect()` and debugging messages. +* Escape U+007F DELETE when serializing strings. + * When generating CSS error messages to display in-browser, escape all code points that aren't in the US-ASCII region. Previously only code points U+0100 LATIN CAPITAL LETTER A WITH MACRON were escaped. diff --git a/lib/src/visitor/serialize.dart b/lib/src/visitor/serialize.dart index 676a4876b..9ab203073 100644 --- a/lib/src/visitor/serialize.dart +++ b/lib/src/visitor/serialize.dart @@ -1090,7 +1090,8 @@ final class _SerializeVisitor $fs || $gs || $rs || - $us: + $us || + $del: _writeEscape(buffer, char, string, i); case $backslash: