Skip to content

Commit

Permalink
Always add quotes to attribute selector values that begin with -- (#529)
Browse files Browse the repository at this point in the history
Closes #527
  • Loading branch information
nex3 authored Nov 16, 2018
1 parent d4adea7 commit aa52cf1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 4 additions & 1 deletion lib/src/visitor/serialize.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: sass
version: 1.15.0
version: 1.15.1
description: A Sass implementation in Dart.
author: Dart Team <[email protected]>
homepage: https://github.com/sass/dart-sass
Expand Down

0 comments on commit aa52cf1

Please sign in to comment.