do not strip whitespace before comma in psuedo selector
This commit is contained in:
parent
df60ef094c
commit
25862a5af8
@ -319,6 +319,7 @@ impl<'a> Parser<'a> {
|
||||
|
||||
let mut found_curly = false;
|
||||
|
||||
// we resolve interpolation and strip comments
|
||||
while let Some(tok) = self.toks.next() {
|
||||
span = span.merge(tok.pos());
|
||||
match tok.kind {
|
||||
@ -330,16 +331,6 @@ impl<'a> Parser<'a> {
|
||||
string.push('#');
|
||||
}
|
||||
}
|
||||
',' => {
|
||||
while let Some(c) = string.pop() {
|
||||
if c == ' ' || c == ',' {
|
||||
continue;
|
||||
}
|
||||
string.push(c);
|
||||
string.push(',');
|
||||
break;
|
||||
}
|
||||
}
|
||||
'/' => {
|
||||
if self.toks.peek().is_none() {
|
||||
return Err(("Expected selector.", tok.pos()).into());
|
||||
|
@ -668,6 +668,11 @@ test!(
|
||||
"a, // 1\nb,\nc {\n color: red;\n}\n",
|
||||
"a,\nb,\nc {\n color: red;\n}\n"
|
||||
);
|
||||
test!(
|
||||
spaces_are_preserved_before_comma_in_pseudo_arg,
|
||||
":a(a , b) {\n color: &;\n}\n",
|
||||
":a(a , b) {\n color: :a(a , b);\n}\n"
|
||||
);
|
||||
error!(
|
||||
a_n_plus_b_n_invalid_odd,
|
||||
":nth-child(ofdd) {\n color: &;\n}\n", "Error: Expected \"odd\"."
|
||||
|
Loading…
x
Reference in New Issue
Block a user