From aa52cf1474cf68318739ead2a96f02d4946ded06 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Fri, 16 Nov 2018 13:51:36 -0800 Subject: [PATCH] Always add quotes to attribute selector values that begin with -- (#529) Closes #527 --- CHANGELOG.md | 5 +++++ lib/src/visitor/serialize.dart | 5 ++++- pubspec.yaml | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 000ca8b73..75619967f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.15.1 + +* Always add quotes to attribute selector values that begin with `--`, since IE + 11 doesn't consider them to be identifiers. + ## 1.15.0 * Add support for passing arguments to `@content` blocks. See [the diff --git a/lib/src/visitor/serialize.dart b/lib/src/visitor/serialize.dart index d67db1829..ed7a44bd4 100644 --- a/lib/src/visitor/serialize.dart +++ b/lib/src/visitor/serialize.dart @@ -1154,9 +1154,12 @@ class _SerializeVisitor implements CssVisitor, ValueVisitor, SelectorVisitor { } /// Returns whether [text] is a valid identifier. + /// + /// This *doesn't* consider identifiers beginning with `--` to be valid, + /// because IE 11 doesn't. bool _isIdentifier(String text) { var scanner = StringScanner(text); - while (scanner.scanChar($dash)) {} + scanner.scanChar($dash); if (scanner.isDone) return false; var first = scanner.readChar(); diff --git a/pubspec.yaml b/pubspec.yaml index 996bd07be..03bddf0a7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: sass -version: 1.15.0 +version: 1.15.1 description: A Sass implementation in Dart. author: Dart Team homepage: https://github.com/sass/dart-sass