Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape non-US-ASCII characters in SassException.toCssString() #2143

Merged
merged 3 commits into from
Dec 8, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/src/exception.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down