postcss 8.5.21 → 8.5.23
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/README.md +1 -2
- package/lib/previous-map.js +5 -11
- package/lib/processor.js +1 -1
- package/lib/stringifier.js +6 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,8 +13,7 @@ and JetBrains. The [Autoprefixer] and [Stylelint] PostCSS plugins are some o
|
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
|
-
<img src="https://cdn.evilmartians.com/badges/logo-no-label.svg" alt="" width="22" height="16" />
|
|
17
|
-
<b><a href="https://evilmartians.com/devtools?utm_source=postcss&utm_campaign=devtools-button&utm_medium=github">Evil Martians</a></b>, go-to agency for <b>developer tools</b>.
|
|
16
|
+
<img src="https://cdn.evilmartians.com/badges/logo-no-label.svg" alt="" width="22" height="16" /> PostCSS is built by <b><a href="https://evilmartians.com/>Evil Martians</a></b>, an American design and engineering consultancy for <b>developer tools, AI, and cybersecurity startups</b>.
|
|
18
17
|
|
|
19
18
|
---
|
|
20
19
|
|
package/lib/previous-map.js
CHANGED
|
@@ -86,19 +86,13 @@ class PreviousMap {
|
|
|
86
86
|
|
|
87
87
|
loadFile(path, cssFile, trusted) {
|
|
88
88
|
if (!trusted && !this.unsafeMap) {
|
|
89
|
-
if (!/\.map$/i.test(path))
|
|
89
|
+
if (!/\.map$/i.test(path)) return undefined
|
|
90
|
+
if (!cssFile) return undefined
|
|
91
|
+
|
|
92
|
+
let rel = relative(dirname(cssFile), path)
|
|
93
|
+
if (rel === '..' || rel.startsWith('..' + sep) || isAbsolute(rel)) {
|
|
90
94
|
return undefined
|
|
91
95
|
}
|
|
92
|
-
if (cssFile) {
|
|
93
|
-
let relativePath = relative(dirname(cssFile), path)
|
|
94
|
-
if (
|
|
95
|
-
relativePath === '..' ||
|
|
96
|
-
relativePath.startsWith('..' + sep) ||
|
|
97
|
-
isAbsolute(relativePath)
|
|
98
|
-
) {
|
|
99
|
-
return undefined
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
96
|
}
|
|
103
97
|
this.root = dirname(path)
|
|
104
98
|
if (existsSync(path)) {
|
package/lib/processor.js
CHANGED
package/lib/stringifier.js
CHANGED
|
@@ -62,14 +62,15 @@ function pushBody(str, stack, node) {
|
|
|
62
62
|
for (let i = nodes.length - 1; i >= 0; i--) {
|
|
63
63
|
let child = nodes[i]
|
|
64
64
|
let childSemicolon = last !== i || semicolon
|
|
65
|
-
// A childless at-rule
|
|
66
|
-
// terminated. Without the semicolon those
|
|
67
|
-
// into the at-rule's prelude
|
|
65
|
+
// A childless at-rule or a custom property declaration that still has
|
|
66
|
+
// following siblings must be terminated. Without the semicolon those
|
|
67
|
+
// trailing comments are folded into the at-rule's prelude or the custom
|
|
68
|
+
// property's value and disappear when the output is re-parsed.
|
|
68
69
|
if (
|
|
69
70
|
!childSemicolon &&
|
|
70
71
|
i < nodes.length - 1 &&
|
|
71
|
-
child.type === 'atrule' &&
|
|
72
|
-
|
|
72
|
+
((child.type === 'atrule' && !child.nodes) ||
|
|
73
|
+
(child.type === 'decl' && child.prop.startsWith('--')))
|
|
73
74
|
) {
|
|
74
75
|
childSemicolon = true
|
|
75
76
|
}
|