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

Words that are not visible are being counted as matches #23

Closed
DavidAccola opened this issue Feb 25, 2023 · 4 comments
Closed

Words that are not visible are being counted as matches #23

DavidAccola opened this issue Feb 25, 2023 · 4 comments

Comments

@DavidAccola
Copy link

For the page I'm trying to implement find-in-nw in, all instances of the word are being counted as matches whether they are visible or not.

matching all instances
In this example, "notfound" is visible 2 times, but 17 instances are highlighted.

Example html file attached.

Example.zip

@TheJaredWilcurt
Copy link
Member

Fixed in v1.3.0

@DavidAccola
Copy link
Author

DavidAccola commented Feb 26, 2023

Thank you for working on this!
Hmm, I just tested in this same Example.html document using v1.3.0 and in my testing the same thing still happens. That maybe has more to do with this specific Example.html than findinnw.

@TheJaredWilcurt
Copy link
Member

Updated to v2.0.0. For your example specifically, you'll need to pass in these options during the initialization.

  <script>
    findInNw.initialize({
      classesToIgnore: [
        'arrow',
        'backToTop',
        'nav-item',
        'tooltip'
      ],
      idsToIgnore: [
        'openAll',
        'openAllFailed',
        'openAllRequests',
        'showOnlyFailures'
      ]
    });
  </script>

The README has been updated to explain how to use these new options.

@DavidAccola
Copy link
Author

Fantastic! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants