We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
reContextSelector
:scope
1 parent 1ed7173 commit ae6d66dCopy full SHA for ae6d66d
src/api/traversing.ts
@@ -24,7 +24,7 @@ import {
24
uniqueSort,
25
} from 'domutils';
26
import type { FilterFunction, AcceptedFilters } from '../types.js';
27
-const reSiblingSelector = /^\s*[+~:]/;
+const reContextSelector = /^\s*(?:[+~]|:scope\b)/;
28
29
/**
30
* Get the descendants of each element in the current set of matched elements,
@@ -83,7 +83,7 @@ export function _findBySelector<T extends AnyNode>(
83
): Cheerio<Element> {
84
const context = this.toArray();
85
86
- const elems = reSiblingSelector.test(selector)
+ const elems = reContextSelector.test(selector)
87
? context
88
: this.children().toArray();
89
0 commit comments