Properly parse escaped digits at the beginning of identifiers (#486)

See sass/sass#1542
Closes sass/dart-sass#485
This commit is contained in:
Natalie Weizenbaum 2018-09-26 21:01:46 -04:00 committed by GitHub
parent b3c9e7b00f
commit ff3cea5312
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,7 @@
## 1.14.1
* Canonicalize escaped digits at the beginning of identifiers as hex escapes.
* Properly parse property declarations that are both *in* content blocks and
written *after* content blocks.

View File

@ -395,7 +395,9 @@ abstract class Parser {
if (identifierStart ? isNameStart(value) : isName(value)) {
return new String.fromCharCode(value);
} else if (value < 0x1F || value == 0x7F) {
} else if (value < 0x1F ||
value == 0x7F ||
(identifierStart && isDigit(value))) {
var buffer = new StringBuffer()..writeCharCode($backslash);
if (value > 0xF) buffer.writeCharCode(hexCharFor(value >> 4));
buffer.writeCharCode(hexCharFor(value & 0xF));

View File

@ -1,5 +1,5 @@
name: sass
version: 1.14.1-dev
version: 1.14.1
description: A Sass implementation in Dart.
author: Dart Team <misc@dartlang.org>
homepage: https://github.com/sass/dart-sass