correctly parse styles after @supports
and unknown at rules
This commit is contained in:
parent
b4bdd2f926
commit
d56100a324
@ -546,7 +546,7 @@ impl<'a> Parser<'a> {
|
|||||||
params.push(tok.kind);
|
params.push(tok.kind);
|
||||||
}
|
}
|
||||||
|
|
||||||
let raw_body = self.parse()?;
|
let raw_body = self.parse_stmt()?;
|
||||||
let mut rules = Vec::with_capacity(raw_body.len());
|
let mut rules = Vec::with_capacity(raw_body.len());
|
||||||
let mut body = Vec::new();
|
let mut body = Vec::new();
|
||||||
|
|
||||||
@ -782,7 +782,7 @@ impl<'a> Parser<'a> {
|
|||||||
extender: self.extender,
|
extender: self.extender,
|
||||||
content_scopes: self.content_scopes,
|
content_scopes: self.content_scopes,
|
||||||
}
|
}
|
||||||
.parse()?;
|
.parse_stmt()?;
|
||||||
|
|
||||||
let mut rules = Vec::with_capacity(raw_body.len());
|
let mut rules = Vec::with_capacity(raw_body.len());
|
||||||
let mut body = Vec::new();
|
let mut body = Vec::new();
|
||||||
|
18
tests/supports.rs
Normal file
18
tests/supports.rs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#![cfg(test)]
|
||||||
|
|
||||||
|
#[macro_use]
|
||||||
|
mod macros;
|
||||||
|
|
||||||
|
test!(
|
||||||
|
style_following,
|
||||||
|
"@supports (a: b) {
|
||||||
|
a {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: green;
|
||||||
|
}",
|
||||||
|
"@supports (a: b) {\n a {\n color: red;\n }\n}\na {\n color: green;\n}\n"
|
||||||
|
);
|
@ -16,3 +16,16 @@ test!(
|
|||||||
"@false;\n"
|
"@false;\n"
|
||||||
);
|
);
|
||||||
test!(nothing_after_hash, "@foo #", "@foo #;\n");
|
test!(nothing_after_hash, "@foo #", "@foo #;\n");
|
||||||
|
test!(
|
||||||
|
style_following,
|
||||||
|
"@foo (a: b) {
|
||||||
|
a {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: green;
|
||||||
|
}",
|
||||||
|
"@foo (a: b) {\n a {\n color: red;\n }\n}\na {\n color: green;\n}\n"
|
||||||
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user