postcss 8.4.7 → 8.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of postcss might be problematic. Click here for more details.

package/lib/parser.js CHANGED
@@ -12,6 +12,14 @@ const SAFE_COMMENT_NEIGHBOR = {
12
12
  space: true
13
13
  }
14
14
 
15
+ function findLastWithPosition(tokens) {
16
+ for (let i = tokens.length - 1; i >= 0; i--) {
17
+ let token = tokens[i]
18
+ let pos = token[3] || token[2]
19
+ if (pos) return pos
20
+ }
21
+ }
22
+
15
23
  class Parser {
16
24
  constructor(input) {
17
25
  this.input = input
@@ -177,7 +185,10 @@ class Parser {
177
185
  this.semicolon = true
178
186
  tokens.pop()
179
187
  }
180
- node.source.end = this.getPosition(last[3] || last[2])
188
+
189
+ node.source.end = this.getPosition(
190
+ last[3] || last[2] || findLastWithPosition(tokens)
191
+ )
181
192
 
182
193
  while (tokens[0][0] !== 'word') {
183
194
  if (tokens.length === 1) this.unknownWord(tokens)
package/lib/processor.js CHANGED
@@ -7,7 +7,7 @@ let Root = require('./root')
7
7
 
8
8
  class Processor {
9
9
  constructor(plugins = []) {
10
- this.version = '8.4.7'
10
+ this.version = '8.4.8'
11
11
  this.plugins = this.normalize(plugins)
12
12
  }
13
13
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postcss",
3
- "version": "8.4.7",
3
+ "version": "8.4.8",
4
4
  "description": "Tool for transforming styles with JS plugins",
5
5
  "engines": {
6
6
  "node": "^10 || ^12 || >=14"