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

Returned indexes are incorrect #761

Open
1 of 2 tasks
dafi opened this issue Feb 24, 2024 · 0 comments
Open
1 of 2 tasks

Returned indexes are incorrect #761

dafi opened this issue Feb 24, 2024 · 0 comments
Labels

Comments

@dafi
Copy link

dafi commented Feb 24, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Description of the bug

I search using includeMatches option and when the pattern contains round brackets ( or ) the returned indexes are incorrect

The Fuse.js version where this bug is happening.

7.0.0

Is this a regression?

  • This is a regression bug

Which version did this behavior use to work in?

7.0.0

Steps To Reproduce

I created a complete example to reproduce the issue at https://stackblitz.com/edit/vitejs-vite-ml32lm?file=main.js

As you can see in the first case the returned indexes are identical

Index 0 start 0 end 25

Index 1 start 0 end 25

In second case the index at 1 differs from start only by 1, this create incorrect results when I highlight in HTML

Index 0 start 0 end 23

Index 1 start 1 end 23

Expected behavior

I expect no duplicated indexes and start at index >= 1 always greater than previous end valuey

Screenshots

No response

Additional context

No response

@dafi dafi added the bug label Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant