Skip to content

Commit fb32af0

Browse files
committed
[BUGFIX] Allow comma in selectors (#1293)
Also add a note that the specificity is incorrectly calculated in such cases. This will be addressed with a separate fix.
1 parent e0a904e commit fb32af0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
5555

5656
### Fixed
5757

58+
- Allow comma in selectors (e.g. `:not(html, body)`) (#1293)
5859
- Set line number when `RuleSet::addRule()` called with only column number set
5960
(#1265)
6061
- Ensure first rule added with `RuleSet::addRule()` has valid position (#1262)

src/Property/Selector.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ class Selector
5959
const SELECTOR_VALIDATION_RX = '/
6060
^(
6161
(?:
62-
[a-zA-Z0-9\x{00A0}-\x{FFFF}_^$|*="\'~\[\]()\-\s\.:#+>]* # any sequence of valid unescaped characters
63-
(?:\\\\.)? # a single escaped character
64-
(?:([\'"]).*?(?<!\\\\)\2)? # a quoted text like [id="example"]
62+
[a-zA-Z0-9\\x{00A0}-\\x{FFFF}_^$|*="\'~\\[\\]()\\-\\s\\.:#+>,]* # any sequence of valid unescaped characters
63+
(?:\\\\.)? # a single escaped character
64+
(?:([\'"]).*?(?<!\\\\)\\2)? # a quoted text like [id="example"]
6565
)*
6666
)$
6767
/ux';

0 commit comments

Comments
 (0)