From afef31b8085a667687a54fb08be32aad9fbdd58c Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Sat, 18 Jan 2020 10:26:29 -0500 Subject: [PATCH] Normalize units in selector --- src/selector.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/selector.rs b/src/selector.rs index fe5b0cd..601193c 100644 --- a/src/selector.rs +++ b/src/selector.rs @@ -242,7 +242,8 @@ impl<'a> SelectorParser<'a> { } if let Some(Token { kind, .. }) = tokens.next() { match &kind { - TokenKind::Ident(tok) => self.selectors.push(SelectorKind::Element(tok.clone())), + TokenKind::Ident(ident) => self.selectors.push(SelectorKind::Element(ident.clone())), + TokenKind::Unit(u) => self.selectors.push(SelectorKind::Element(u.to_string())), TokenKind::Symbol(Symbol::Period) => self.selectors.push(SelectorKind::Class), TokenKind::Symbol(Symbol::Hash) => self.selectors.push(SelectorKind::Id), TokenKind::Symbol(Symbol::Colon) => self.consume_pseudo_selector(tokens),