From 3eca26584dc26947f4efcd7626ac5e0f3f8bd859 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Wed, 11 Aug 2021 01:52:17 +0000 Subject: [PATCH] Fix a single-backslash attribute selector (#1428) Closes #1423 --- CHANGELOG.md | 3 +++ lib/src/parse/parser.dart | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce37bab8..f1c4d2e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## 1.37.6 +* Fix a bug where quotes would be omitted for an attribute selector whose value + was a single backslash. + * Allow `if` to be used as an unquoted string. * Properly parse backslash escapes within `url()` expressions. diff --git a/lib/src/parse/parser.dart b/lib/src/parse/parser.dart index da0aeae7..271d1d80 100644 --- a/lib/src/parse/parser.dart +++ b/lib/src/parse/parser.dart @@ -441,7 +441,7 @@ class Parser { var value = 0; var first = scanner.peekChar(); if (first == null) { - return ""; + scanner.error("Expected escape sequence."); } else if (isNewline(first)) { scanner.error("Expected escape sequence."); } else if (isHex(first)) {