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

Search on regexp characters broken by v2.3.0 #699

Open
machupichu123 opened this issue Dec 1, 2020 · 10 comments · May be fixed by #721
Open

Search on regexp characters broken by v2.3.0 #699

machupichu123 opened this issue Dec 1, 2020 · 10 comments · May be fixed by #721

Comments

@machupichu123
Copy link

machupichu123 commented Dec 1, 2020

I found a problem caused by a different version.

I can't search the symbols #, . and - when using a var 2.3.0.

For example, here is the code.
https://jsfiddle.net/qrhd438e/

In case of I use var 1.5.0 result shows 'Mark #Twain',
But var 2.3.0 shows nothing.

@machupichu123 machupichu123 changed the title function is not wark at item option at var 2.3.0 problem caused by a different version. Dec 1, 2020
@sheffieldnikki
Copy link
Contributor

I think it is probably a bug in setSearchString() where it is escaping regular expression characters (like #, -, etc) but the new faster multiword search code in v2.3.0 doesn't use regexp, so those characters shouldn't be escaped?

@machupichu123
Copy link
Author

Thank you. I solved it by commenting out line 744 of 2.3.0.

744 s = s.replace(/[-[]{}()+?.,^$|#]/g, '$&'); // Escape regular expression characters

744 // s = s.replace(/[-[]{}()+?.,^$|#]/g, '$&'); // Escape regular expression characters

@machupichu123
Copy link
Author

I am expecting great things of you!
What do you think of this issue?
#698

@sheffieldnikki
Copy link
Contributor

I suggest renaming this issue to something specific, like "Search on regexp characters broken by v2.3.0"

@machupichu123 machupichu123 changed the title problem caused by a different version. Search on regexp characters broken by v2.3.0 Dec 3, 2020
@machupichu123
Copy link
Author

I Fixed the title.
Why did you thumbs down?
Are you angry with me, by any chance?
I'm concerning about that if my English makes sense or not.

@levipadre
Copy link

Hello, when can we expect a fixture for this? I'm also having issue with - character. I have a list of API keys, e.g. FC6F7D6B-BADD-0DD4-A7B0-EB34A1EFA527 and I can't search perfect match, not even with fuzzy search.
Thank you in advance.

@pouriap
Copy link

pouriap commented Nov 17, 2022

Thank you.

I hope this gets fixed soon.
Almost any link or file name contains characters such as #, ., -, etc. This is a huge disadvantage. Hopefully commenting out that line doesn't break anything.

@lovasoa
Copy link

lovasoa commented Aug 3, 2023

I merged the fix in https://www.npmjs.com/package/list.js-fixed to be able to use it in SQLPage

@Glamurio
Copy link

Glamurio commented Dec 6, 2023

Chiming in to hope this gets fixed. Even all the "fixes" don't seem to solve this issue. We're using it to sort books, and among which you can search and sort for ISBN numbers, which typically look something like 978-1-09-813107-4. While searching for "978" finds something, searching for the entire string doesn't, which is vital.

@lovasoa
Copy link

lovasoa commented Dec 6, 2023

Even all the "fixes" don't seem to solve this issue.

What do you mean ? list.js-fixed works with strings that contain dashes. You can have a look at Example 4 on this page.

dragonstyle added a commit to quarto-dev/quarto-cli that referenced this issue Jan 25, 2024
Taken from: javve/list.js#699

Since regex searching isnt used any longer, this escaping isn’t necessary, but it hasn’t been fixed upstream.

Fixes #8435

I believe that the searching is fuzzy, so the `-` doesn’t really provide very functional search filtering. (though other examples like ? are more functional)
cderv added a commit to quarto-dev/quarto-cli that referenced this issue Sep 5, 2024
This is a follow up on a2e298e which patches list.min.js to fix #8435. The fix suggested in javve/list.js#699 only remove the regex handling. Our initial patch was also removing the lowercase processing which broke search.

This fixes #10720
cderv added a commit to quarto-dev/quarto-cli that referenced this issue Sep 6, 2024
This is a follow up on a2e298e which patches list.min.js to fix #8435. The fix suggested in javve/list.js#699 only remove the regex handling. Our initial patch was also removing the lowercase processing which broke search.

This fixes #10720
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

Successfully merging a pull request may close this issue.

6 participants