postcss-styl
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -776,6 +776,13 @@ "use strict" | ||
} else { | ||
const betweenLength = ( | ||
parsedNameAndCondition.raw.stylusBetween || | ||
parsedNameAndCondition.raw.between | ||
).length | ||
atRuleSource = { | ||
start: this.sourceCode.getLoc(startIndex), | ||
input: this.input, | ||
end: this.sourceCode.getLoc(parsedNameAndCondition.endIndex), | ||
end: this.sourceCode.getLoc( | ||
parsedNameAndCondition.endIndex - betweenLength | ||
), | ||
rawEnd: this.sourceCode.getLoc(parsedNameAndCondition.endIndex), | ||
} | ||
@@ -1518,5 +1525,18 @@ atRuleRaws = { | ||
if (last) { | ||
let prevNode = last | ||
let endIndex = this.sourceCode.getIndex( | ||
prevNode.source.rawEnd || prevNode.source.end | ||
) | ||
while (prevNode.last) { | ||
prevNode = prevNode.last | ||
if (prevNode.source.rawEnd) { | ||
endIndex = Math.max( | ||
endIndex, | ||
this.sourceCode.getIndex(prevNode.source.rawEnd) | ||
) | ||
} | ||
} | ||
parsedRawBefore = parseRawBefore( | ||
this.sourceCode, | ||
this.sourceCode.getIndex(last.source.end) + 1, | ||
endIndex + 1, | ||
end && this.sourceCode.getIndex(end) | ||
@@ -1523,0 +1543,0 @@ ) |
@@ -36,7 +36,4 @@ "use strict" | ||
// end | ||
tokens.push(...spaces) | ||
if (token.type === "linebreak") { | ||
// between.push(token) | ||
endIndex = token.range[0] - 1 | ||
} else { | ||
if (token.type === "inline-comment") { | ||
tokens.push(...spaces) | ||
tokens.push(token) | ||
@@ -57,5 +54,2 @@ endIndex = token.range[1] - 1 | ||
// end | ||
endIndex = | ||
(spaces.length ? spaces[0].range[0] : token.range[0]) - | ||
1 | ||
break | ||
@@ -66,3 +60,3 @@ } | ||
if (isSkipToken(token)) { | ||
if (token.type === "whitespace") { | ||
spaces.push(token) | ||
@@ -79,2 +73,3 @@ } else { | ||
} | ||
return { | ||
@@ -81,0 +76,0 @@ tokens, |
{ | ||
"name": "postcss-styl", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "PostCSS parser plugin for converting Stylus syntax to PostCSS AST.", | ||
@@ -9,3 +9,3 @@ "main": "lib/index.js", | ||
"pretest": "npm run lint", | ||
"test:base": "mocha \"tests/**/*.js\" --reporter dot", | ||
"test:base": "cross-env DEBUG=postcss-styl* mocha \"tests/**/*.js\" --reporter dot", | ||
"test:update-fixtures": "cross-env UPDATE_FIXTURES=true npm run test:base", | ||
@@ -12,0 +12,0 @@ "test": "npm run test:nyc", |
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
120689
3738