diff --git a/CHANGELOG.md b/CHANGELOG.md index 67c678c5e..31b33c809 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ * Produce better output for numbers with complex units in `meta.inspect()` and debugging messages. +* 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. + ### JS API * Fix a bug where certain exceptions could produce `SourceSpan`s that didn't diff --git a/lib/src/exception.dart b/lib/src/exception.dart index 69dbbe7e5..898258c88 100644 --- a/lib/src/exception.dart +++ b/lib/src/exception.dart @@ -82,12 +82,12 @@ class SassException extends SourceSpanException { .replaceAll("\r\n", "\n"); term_glyph.ascii = wasAscii; - // For the string comment, render all non-ASCII characters as escape + // For the string comment, render all non-US-ASCII characters as escape // sequences so that they'll show up even if the HTTP headers are set // incorrectly. var stringMessage = StringBuffer(); for (var rune in SassString(toString(color: false)).toString().runes) { - if (rune > 0xFF) { + if (rune > 0x7F) { stringMessage ..writeCharCode($backslash) ..write(rune.toRadixString(16))