allow escapes at the start of selectors
This commit is contained in:
parent
374e9f9eb4
commit
eea8bdbc25
@ -157,7 +157,7 @@ impl<'a> StyleSheetParser<'a> {
|
||||
while let Some(Token { kind, .. }) = self.lexer.peek() {
|
||||
match kind {
|
||||
'a'..='z' | 'A'..='Z' | '_' | '-' | '0'..='9'
|
||||
| '[' | '#' | ':' | '*' | '%' | '.' | '>' => rules
|
||||
| '[' | '#' | ':' | '*' | '%' | '.' | '>' | '\\' => rules
|
||||
.extend(self.eat_rules(&Selector::new(), &mut Scope::new())?),
|
||||
&'\t' | &'\n' | ' ' => {
|
||||
self.lexer.next();
|
||||
|
@ -507,3 +507,8 @@ test!(
|
||||
"a, %b {\n color: nth(&, 2);\n}\n",
|
||||
"a {\n color: %b;\n}\n"
|
||||
);
|
||||
test!(
|
||||
escape_at_start_of_selector,
|
||||
"\\61 {\n color: red;\n}\n",
|
||||
"a {\n color: red;\n}\n"
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user