@emmetio/css-abbreviation
Advanced tools
Comparing version 2.0.1 to 2.1.0
@@ -451,3 +451,4 @@ 'use strict'; | ||
const token = peek(scanner); | ||
if (!options.value && isLiteral$1(token) && !isFunctionStart(scanner)) { | ||
const valueMode = !!options.value; | ||
if (!valueMode && isLiteral$1(token) && !isFunctionStart(scanner)) { | ||
scanner.pos++; | ||
@@ -459,3 +460,5 @@ name = token.value; | ||
// Skip whitespace right after property name, if any | ||
consume(scanner, isWhiteSpace); | ||
if (valueMode) { | ||
consume(scanner, isWhiteSpace); | ||
} | ||
while (readable(scanner)) { | ||
@@ -465,3 +468,3 @@ if (consume(scanner, isImportant)) { | ||
} | ||
else if (valueFragment = consumeValue(scanner)) { | ||
else if (valueFragment = consumeValue(scanner, valueMode)) { | ||
value.push(valueFragment); | ||
@@ -480,3 +483,3 @@ } | ||
*/ | ||
function consumeValue(scanner) { | ||
function consumeValue(scanner, inArgument) { | ||
const result = []; | ||
@@ -500,3 +503,3 @@ let token; | ||
} | ||
else if (isValueDelimiter(token)) { | ||
else if (isValueDelimiter(token) || (inArgument && isWhiteSpace(token))) { | ||
scanner.pos++; | ||
@@ -518,3 +521,3 @@ } | ||
while (readable(scanner) && !consume(scanner, isCloseBracket)) { | ||
if (value = consumeValue(scanner)) { | ||
if (value = consumeValue(scanner, true)) { | ||
args.push(value); | ||
@@ -555,3 +558,3 @@ } | ||
function isFragmentDelimiter(token) { | ||
return isArgumentDelimiter(token) || isWhiteSpace(token); | ||
return isArgumentDelimiter(token); | ||
} | ||
@@ -569,4 +572,3 @@ function isImportant(token) { | ||
function isValueDelimiter(token) { | ||
return isWhiteSpace(token) | ||
|| isOperator(token, ":" /* PropertyDelimiter */) | ||
return isOperator(token, ":" /* PropertyDelimiter */) | ||
|| isOperator(token, "-" /* ValueDelimiter */); | ||
@@ -573,0 +575,0 @@ } |
@@ -444,3 +444,4 @@ import Scanner, { isNumber, isAlpha, isAlphaWord, isQuote, isSpace, isAlphaNumericWord, ScannerError } from '@emmetio/scanner'; | ||
const token = peek(scanner); | ||
if (!options.value && isLiteral$1(token) && !isFunctionStart(scanner)) { | ||
const valueMode = !!options.value; | ||
if (!valueMode && isLiteral$1(token) && !isFunctionStart(scanner)) { | ||
scanner.pos++; | ||
@@ -452,3 +453,5 @@ name = token.value; | ||
// Skip whitespace right after property name, if any | ||
consume(scanner, isWhiteSpace); | ||
if (valueMode) { | ||
consume(scanner, isWhiteSpace); | ||
} | ||
while (readable(scanner)) { | ||
@@ -458,3 +461,3 @@ if (consume(scanner, isImportant)) { | ||
} | ||
else if (valueFragment = consumeValue(scanner)) { | ||
else if (valueFragment = consumeValue(scanner, valueMode)) { | ||
value.push(valueFragment); | ||
@@ -473,3 +476,3 @@ } | ||
*/ | ||
function consumeValue(scanner) { | ||
function consumeValue(scanner, inArgument) { | ||
const result = []; | ||
@@ -493,3 +496,3 @@ let token; | ||
} | ||
else if (isValueDelimiter(token)) { | ||
else if (isValueDelimiter(token) || (inArgument && isWhiteSpace(token))) { | ||
scanner.pos++; | ||
@@ -511,3 +514,3 @@ } | ||
while (readable(scanner) && !consume(scanner, isCloseBracket)) { | ||
if (value = consumeValue(scanner)) { | ||
if (value = consumeValue(scanner, true)) { | ||
args.push(value); | ||
@@ -548,3 +551,3 @@ } | ||
function isFragmentDelimiter(token) { | ||
return isArgumentDelimiter(token) || isWhiteSpace(token); | ||
return isArgumentDelimiter(token); | ||
} | ||
@@ -562,4 +565,3 @@ function isImportant(token) { | ||
function isValueDelimiter(token) { | ||
return isWhiteSpace(token) | ||
|| isOperator(token, ":" /* PropertyDelimiter */) | ||
return isOperator(token, ":" /* PropertyDelimiter */) | ||
|| isOperator(token, "-" /* ValueDelimiter */); | ||
@@ -566,0 +568,0 @@ } |
{ | ||
"name": "@emmetio/css-abbreviation", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "Parses Emmet CSS abbreviation into AST tree", | ||
@@ -46,3 +46,3 @@ "main": "./dist/css-abbreviation.cjs.js", | ||
}, | ||
"gitHead": "b930c88a1c90af11f42fc9622d0712efc10bc454" | ||
"gitHead": "baacc1e0ec3a5b3bc4a329ddae48e1f4245dd45f" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43474
1313