postcss 8.5.20 → 8.5.21
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.
- package/lib/node.d.ts +2 -2
- package/lib/processor.js +1 -1
- package/lib/stringifier.js +15 -2
- package/package.json +1 -1
package/lib/node.d.ts
CHANGED
|
@@ -31,12 +31,12 @@ declare namespace Node {
|
|
|
31
31
|
|
|
32
32
|
export interface Position {
|
|
33
33
|
/**
|
|
34
|
-
* Source
|
|
34
|
+
* Source column in file. It starts from 1.
|
|
35
35
|
*/
|
|
36
36
|
column: number
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
|
-
* Source
|
|
39
|
+
* Source line in file. It starts from 1.
|
|
40
40
|
*/
|
|
41
41
|
line: number
|
|
42
42
|
|
package/lib/processor.js
CHANGED
package/lib/stringifier.js
CHANGED
|
@@ -60,10 +60,23 @@ function pushBody(str, stack, node) {
|
|
|
60
60
|
let semicolon = str.raw(node, 'semicolon')
|
|
61
61
|
let isDocument = node.type === 'document'
|
|
62
62
|
for (let i = nodes.length - 1; i >= 0; i--) {
|
|
63
|
+
let child = nodes[i]
|
|
64
|
+
let childSemicolon = last !== i || semicolon
|
|
65
|
+
// A childless at-rule that still has following siblings must be
|
|
66
|
+
// terminated. Without the semicolon those trailing comments are folded
|
|
67
|
+
// into the at-rule's prelude and disappear when the output is re-parsed.
|
|
68
|
+
if (
|
|
69
|
+
!childSemicolon &&
|
|
70
|
+
i < nodes.length - 1 &&
|
|
71
|
+
child.type === 'atrule' &&
|
|
72
|
+
!child.nodes
|
|
73
|
+
) {
|
|
74
|
+
childSemicolon = true
|
|
75
|
+
}
|
|
63
76
|
stack.push({
|
|
64
77
|
document: isDocument,
|
|
65
|
-
node:
|
|
66
|
-
semicolon:
|
|
78
|
+
node: child,
|
|
79
|
+
semicolon: childSemicolon
|
|
67
80
|
})
|
|
68
81
|
}
|
|
69
82
|
}
|