Remove extra commas in selectors
This commit is contained in:
parent
15edae53d6
commit
889488121a
@ -43,6 +43,17 @@ impl Display for Selector {
|
||||
}
|
||||
}
|
||||
}
|
||||
SelectorKind::Multiple => {
|
||||
devour_whitespace(&mut iter);
|
||||
while let Some(sel) = iter.peek() {
|
||||
if sel != &&SelectorKind::Multiple {
|
||||
write!(f, ", ")?;
|
||||
break;
|
||||
}
|
||||
iter.next();
|
||||
devour_whitespace(&mut iter);
|
||||
}
|
||||
}
|
||||
_ => write!(f, "{}", s)?,
|
||||
}
|
||||
}
|
||||
|
@ -309,6 +309,11 @@ mod test_selectors {
|
||||
"$x: oo, ba;\nf#{$x}r {\n baz {\n color: red;\n }\n}\n",
|
||||
"foo baz, bar baz {\n color: red;\n}\n"
|
||||
);
|
||||
test!(
|
||||
extra_commas,
|
||||
"div,, , span, ,, {\n color: red;\n}\n",
|
||||
"div, span {\n color: red;\n}\n"
|
||||
);
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
Loading…
x
Reference in New Issue
Block a user