Skip to content

Commit d6d1064

Browse files
committed
fix: Adjust globalifySelector to not split selectors with parentheses.
1 parent 276037a commit d6d1064

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/modules/globalifySelector.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* escaped combinators like `\~`.
77
*/
88
// TODO: maybe replace this ugly pattern with an actual selector parser? (https://github.com/leaverou/parsel, 2kb)
9-
const combinatorPattern = /(?<!\\)(?:\\\\)*([ >+~,]\s*)(?![^[]+\]|\d)/g;
9+
const combinatorPattern = /(?<!\\)(?:\\\\)*([ >+~,]\s*)(?![^(]*\))(?![^[]+\]|\d)/g;
1010

1111
export function globalifySelector(selector: string) {
1212
const parts = selector.trim().split(combinatorPattern);

0 commit comments

Comments
 (0)