postcss 8.4.6 → 8.4.7
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/node.d.ts +2 -2
- package/lib/parser.js +13 -4
- package/lib/processor.js +1 -1
- package/package.json +2 -2
package/lib/node.d.ts
CHANGED
@@ -3,7 +3,7 @@ import Comment, { CommentProps } from './comment.js'
|
|
3
3
|
import { Stringifier, Syntax } from './postcss.js'
|
4
4
|
import AtRule, { AtRuleProps } from './at-rule.js'
|
5
5
|
import Rule, { RuleProps } from './rule.js'
|
6
|
-
import { WarningOptions } from './warning.js'
|
6
|
+
import Warning, { WarningOptions } from './warning.js'
|
7
7
|
import CssSyntaxError from './css-syntax-error.js'
|
8
8
|
import Result from './result.js'
|
9
9
|
import Input from './input.js'
|
@@ -241,7 +241,7 @@ export default abstract class Node {
|
|
241
241
|
*
|
242
242
|
* @return Created warning object.
|
243
243
|
*/
|
244
|
-
warn(result: Result, text: string, opts?: WarningOptions):
|
244
|
+
warn(result: Result, text: string, opts?: WarningOptions): Warning
|
245
245
|
|
246
246
|
/**
|
247
247
|
* Removes the node from its parent and cleans the parent properties
|
package/lib/parser.js
CHANGED
@@ -7,6 +7,11 @@ let AtRule = require('./at-rule')
|
|
7
7
|
let Root = require('./root')
|
8
8
|
let Rule = require('./rule')
|
9
9
|
|
10
|
+
const SAFE_COMMENT_NEIGHBOR = {
|
11
|
+
empty: true,
|
12
|
+
space: true
|
13
|
+
}
|
14
|
+
|
10
15
|
class Parser {
|
11
16
|
constructor(input) {
|
12
17
|
this.input = input
|
@@ -418,10 +423,14 @@ class Parser {
|
|
418
423
|
if (type === 'space' && i === length - 1 && !customProperty) {
|
419
424
|
clean = false
|
420
425
|
} else if (type === 'comment') {
|
421
|
-
prev = tokens[i - 1]
|
422
|
-
next = tokens[i + 1]
|
423
|
-
if (prev &&
|
424
|
-
value
|
426
|
+
prev = tokens[i - 1] ? tokens[i - 1][0] : 'empty'
|
427
|
+
next = tokens[i + 1] ? tokens[i + 1][0] : 'empty'
|
428
|
+
if (!SAFE_COMMENT_NEIGHBOR[prev] && !SAFE_COMMENT_NEIGHBOR[next]) {
|
429
|
+
if (value.slice(-1) === ',') {
|
430
|
+
clean = false
|
431
|
+
} else {
|
432
|
+
value += token[1]
|
433
|
+
}
|
425
434
|
} else {
|
426
435
|
clean = false
|
427
436
|
}
|
package/lib/processor.js
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "postcss",
|
3
|
-
"version": "8.4.
|
3
|
+
"version": "8.4.7",
|
4
4
|
"description": "Tool for transforming styles with JS plugins",
|
5
5
|
"engines": {
|
6
6
|
"node": "^10 || ^12 || >=14"
|
@@ -65,7 +65,7 @@
|
|
65
65
|
"url": "https://github.com/postcss/postcss/issues"
|
66
66
|
},
|
67
67
|
"dependencies": {
|
68
|
-
"nanoid": "^3.
|
68
|
+
"nanoid": "^3.3.1",
|
69
69
|
"picocolors": "^1.0.0",
|
70
70
|
"source-map-js": "^1.0.2"
|
71
71
|
},
|