diff --git a/lib/Sabberworm/CSS/Parser.php b/lib/Sabberworm/CSS/Parser.php index 5a55ba2f..85352926 100644 --- a/lib/Sabberworm/CSS/Parser.php +++ b/lib/Sabberworm/CSS/Parser.php @@ -350,7 +350,10 @@ private static function listDelimiterForRule($sRule) { private function parsePrimitiveValue() { $oValue = null; $this->consumeWhiteSpace(); - if (is_numeric($this->peek()) || (($this->comes('-') || $this->comes('.')) && is_numeric($this->peek(1, 1)))) { + if (is_numeric($this->peek()) || + (($this->comes('-') || $this->comes('.')) && + (($peek = $this->peek(1, 1)) || true) && + (($peek == '.') || is_numeric($peek)))) { $oValue = $this->parseNumericValue(); } else if ($this->comes('#') || $this->comes('rgb') || $this->comes('hsl')) { $oValue = $this->parseColorValue();