From b24993dfbbcf0d8f478f604bcbe1cfd41c4d78cd Mon Sep 17 00:00:00 2001 From: Marek Lewandowski Date: Wed, 30 Nov 2016 17:44:19 +0100 Subject: [PATCH] Fixed hsla value regexp. --- core/tools.js | 2 +- tests/core/tools/style.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/tools.js b/core/tools.js index 8e6a13115d1..a5d8691a78a 100644 --- a/core/tools.js +++ b/core/tools.js @@ -1497,7 +1497,7 @@ _rgbaRegExp: /rgba?\(\s*\d+%?\s*,\s*\d+%?\s*,\s*\d+%?\s*(?:,\s*[0-9.]+\s*)?\)/gi, - _hslaRegExp: /hsla?\(\s*\d+\s*,\s*\d+%\s*,\s*\d+%\s*(?:,\s*[0-9.]+\s*)?\)/gi, + _hslaRegExp: /hsla?\(\s*[0-9.]+\s*,\s*\d+%\s*,\s*\d+%\s*(?:,\s*[0-9.]+\s*)?\)/gi, /** * Parses `value` used as a `background` property shorthand and returns information as an object. diff --git a/tests/core/tools/style.js b/tests/core/tools/style.js index 0af531155f0..0d69aeae232 100644 --- a/tests/core/tools/style.js +++ b/tests/core/tools/style.js @@ -48,9 +48,9 @@ }, 'test style.parse._findColor hsla': function() { - var ret = this.parse._findColor( 'hsl(10,30%,30%) hsla(10,30%,30%,1)' ); + var ret = this.parse._findColor( 'hsl(10,30%,30%) hsla(10,30%,30%,1) hsla( 90.5, 10%, 10%, 1)' ); - arrayAssert.itemsAreEqual( [ 'hsl(10,30%,30%)', 'hsla(10,30%,30%,1)' ], ret ); + arrayAssert.itemsAreEqual( [ 'hsl(10,30%,30%)', 'hsla(10,30%,30%,1)', 'hsla( 90.5, 10%, 10%, 1)' ], ret ); }, 'test style.parse._findColor predefined': function() {