fix(css): comments in selectors (#3909)

This commit is contained in:
Evilebot Tnawi authored and GitHub committed 2018-02-07 13:20:13 +03:00
1 parent 6b5765da36
commit 9e6bd15ade
10 files changed
+249 -64

No files matched your search

+6 -2
View File
@@ -11,7 +11,7 @@ function parseSelector(selector) {
if (selector.match(/\/\/|\/\*/)) {
return {
type: "selector-comment",
value: selector
value: selector.replace(/^ +/, "").replace(/ +$/, "")
};
}
const selectorParser = require("postcss-selector-parser");
@@ -218,10 +218,14 @@ function parseNestedCSS(node) {
}
if (typeof node.selector === "string" && node.selector.trim().length > 0) {
const selector = node.raws.selector
let selector = node.raws.selector
? node.raws.selector.raw
: node.selector;
if (node.raws.between && node.raws.between.trim()) {
selector += node.raws.between;
}
if (selector.startsWith("@") && selector.endsWith(":")) {
return node;
}