diff --git a/src/selector.rs b/src/selector.rs index 11e2c19..8993b34 100644 --- a/src/selector.rs +++ b/src/selector.rs @@ -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::() ), - SelectorKind::InterpolatedSuper => write!(f, " "), - SelectorKind::Super | SelectorKind::None => { + SelectorKind::Super | SelectorKind::None | SelectorKind::InterpolatedSuper => { write!(f, "") } } diff --git a/tests/main.rs b/tests/main.rs index 8af5a56..066a8f2 100644 --- a/tests/main.rs +++ b/tests/main.rs @@ -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 }",