Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

~ and + combinators don't work #70

Open
eigood opened this issue May 21, 2024 · 1 comment
Open

~ and + combinators don't work #70

eigood opened this issue May 21, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@eigood
Copy link

eigood commented May 21, 2024

if (!matchRight(node)) return false;

The calls to matchLeft() and matchRight() are incorrect; they need to pass the parent and index down. As in, matchLeft(node, parent, i) and matchRight(node, parent, i). Otherwise, when using multiple combinators, the parent is never passed down, and will always be undefined, so lines 195 and 202 will always trigger, and return false.

<div>
  <div id="w-node-_77cf40d0-cb39-d173-d0ed-0a30bcbbda03-70cc1f5d">
    Section Title
  </div>
  <div class="div-block-15">
    <div class="textblock">To match</div>
  </div>
</div>
selector="#w-node-_77cf40d0-cb39-d173-d0ed-0a30bcbbda03-70cc1f5d ~ .div-block-15 > .textblock'
@natemoo-re
Copy link
Owner

Ah good catch, thank you for raising that! If you're up for a PR that would be very helpful, otherwise it might take me a bit to dive back into cleaning up the issues here.

@natemoo-re natemoo-re added the bug Something isn't working label May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants