From 6bc4fb1c347155d89e7bf98ae9db8a0c8eda2885 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Sat, 14 Jan 2017 17:06:05 -0800 Subject: [PATCH] Test a unit-parsing edge case on Dart Sass. --- CHANGELOG.md | 2 ++ lib/src/parse/parser.dart | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3827e702..c9f77417 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ * Fix `invert()` with a `$weight` parameter. +* Fix a unit-parsing edge-cases. + ## 1.0.0-alpha.8 * Add the `content-exists()` function. diff --git a/lib/src/parse/parser.dart b/lib/src/parse/parser.dart index da1434da..9d663bd0 100644 --- a/lib/src/parse/parser.dart +++ b/lib/src/parse/parser.dart @@ -108,9 +108,9 @@ abstract class Parser { if (next == null) { break; } else if (unit && next == $dash) { - // Disallow `-` followed by a digit in units. + // Disallow `-` followed by a dot or a digit digit in units. var second = scanner.peekChar(1); - if (second != null && isDigit(second)) break; + if (second != null && (second == $dot || isDigit(second))) break; text.writeCharCode(scanner.readChar()); } else if (isName(next)) { text.writeCharCode(scanner.readChar());