From 9d9997432a9bf0381fb0b39ab9c863f69a0776d8 Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Sun, 19 Apr 2020 22:54:56 -0400 Subject: [PATCH] properly unquote lists --- src/value/mod.rs | 3 +++ tests/interpolation.rs | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/value/mod.rs b/src/value/mod.rs index c2be0b9..c934f79 100644 --- a/src/value/mod.rs +++ b/src/value/mod.rs @@ -214,6 +214,9 @@ impl Value { pub fn unquote(self) -> Self { match self { Self::Ident(s1, _) => Self::Ident(s1, QuoteKind::None), + Self::List(v, sep, bracket) => { + Self::List(v.into_iter().map(|x| x.unquote()).collect(), sep, bracket) + } v => v, } } diff --git a/tests/interpolation.rs b/tests/interpolation.rs index 54863b9..bfd384d 100644 --- a/tests/interpolation.rs +++ b/tests/interpolation.rs @@ -38,3 +38,8 @@ test!( "a {\n color: #{\"#{'\"'}\"};\n}\n", "a {\n color: \";\n}\n" ); +test!( + unquotes_space_separated_list, + "a {\n color: #{\"a\" 'b'};\n}\n", + "a {\n color: a b;\n}\n" +);