Skip to content

allow selector array for chaining selectors #10

Description

@gajus

Consider the following example:

selector: [
  '.movie[data-id="1"]',
  '.item-list a[href^="/reservation"]'
]

We want to ensure .movie[data-id="1"] selector matches 1 element, then we want to select the descending .item-list a[href^="/reservation"] element.

This is different from .movie[data-id="1"] .item-list a[href^="/reservation"]. The latter would match:

<div data-id="1"></div>
<div data-id="1">
  <div class="list-item">
    <a href="/reservation"></a>
  </div>
</div>

The former would not.

An alternative is to allow use of the quantifier expression anywhere in the selector, e.g.

.movie[data-id="1"] {1}[0] .item-list a[href^="/reservation"]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions