Handle whitespace with interpolated super selector
This commit is contained in:
parent
4e6ae91825
commit
3e45f05d97
@ -22,6 +22,7 @@ impl Display for Selector {
|
||||
| SelectorKind::Class
|
||||
| SelectorKind::Id
|
||||
| SelectorKind::Universal
|
||||
| SelectorKind::InterpolatedSuper
|
||||
| SelectorKind::Element(_) => {
|
||||
write!(f, "{}", s)?;
|
||||
if devour_whitespace(&mut iter) {
|
||||
@ -32,6 +33,7 @@ impl Display for Selector {
|
||||
| Some(SelectorKind::Class)
|
||||
| Some(SelectorKind::Id)
|
||||
| Some(SelectorKind::Universal)
|
||||
| Some(SelectorKind::InterpolatedSuper)
|
||||
| Some(SelectorKind::Element(_)) => {
|
||||
write!(f, " ")?;
|
||||
}
|
||||
@ -111,8 +113,7 @@ impl Display for SelectorKind {
|
||||
s,
|
||||
toks.iter().map(ToString::to_string).collect::<String>()
|
||||
),
|
||||
SelectorKind::InterpolatedSuper => write!(f, " "),
|
||||
SelectorKind::Super | SelectorKind::None => {
|
||||
SelectorKind::Super | SelectorKind::None | SelectorKind::InterpolatedSuper => {
|
||||
write!(f, "")
|
||||
}
|
||||
}
|
||||
|
@ -260,10 +260,15 @@ mod test_selectors {
|
||||
"a b a {\n color: red;\n}\n"
|
||||
);
|
||||
test!(
|
||||
selector_interpolation_super_selector_root,
|
||||
selector_interpolation_super_selector_root_postfix,
|
||||
"a#{&} {\nb { color: red; }}",
|
||||
"a b {\n color: red;\n}\n"
|
||||
);
|
||||
test!(
|
||||
selector_interpolation_super_selector_root_prefix,
|
||||
"#{&}a {\nb { color: red; }}",
|
||||
"a b {\n color: red;\n}\n"
|
||||
);
|
||||
test!(
|
||||
selector_whitespace,
|
||||
" a > b , c ~ d e .f #g :h i.j [ k ] { color: red }",
|
||||
|
Loading…
x
Reference in New Issue
Block a user