wix-style-processor
Advanced tools
Comparing version 1.1.17 to 1.1.18
@@ -7,3 +7,3 @@ "use strict"; | ||
var defaultVarDeclarationRegex = /--([^:{)]+):\s*"([^;{]+?)";?/g; | ||
var innerQuotesRegex = /^"([^"]+)"/; | ||
var innerQuotesRegex = /"([^"]+)"/g; | ||
var transformRegex = /^(color|opacity|darken|string|join|number|font|increment|incrementer)\((.*)\)$/; | ||
@@ -58,3 +58,3 @@ var singleTransformRegex = /^(\w*)\(([^()]+)\)$/; | ||
if (innerMatch) { | ||
replacedVal = replaceInnerQuotes(replacedVal, innerMatch[1]); | ||
replacedVal = replaceInnerQuotes(replacedVal, innerMatch); | ||
} | ||
@@ -67,5 +67,7 @@ if (replacedVal[replacedVal.length - 1] === ';') { | ||
} | ||
function replaceInnerQuotes(val, innerVal) { | ||
var evaled = recursiveEval(innerVal); | ||
return val.replace(innerQuotesRegex, evaled); | ||
function replaceInnerQuotes(val, innerVals) { | ||
return innerVals.reduce(function (result, innerVal) { | ||
var evaled = recursiveEval(innerVal.slice(1, -1)); | ||
return result.replace(innerVal, evaled); | ||
}, val); | ||
} | ||
@@ -72,0 +74,0 @@ function recursiveEval(value) { |
@@ -5,3 +5,3 @@ { | ||
"description": "An alternative Wix Styles TPA processor", | ||
"version": "1.1.17", | ||
"version": "1.1.18", | ||
"author": { | ||
@@ -8,0 +8,0 @@ "name": "Eran Shabi", |
Sorry, the diff of this file is not supported yet
50964
566