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

Unable to Find & (ampersand character) correctly #490

Closed
jochristianto opened this issue Feb 9, 2017 · 1 comment
Closed

Unable to Find & (ampersand character) correctly #490

jochristianto opened this issue Feb 9, 2017 · 1 comment

Comments

@jochristianto
Copy link

My data include names like "A & B", "B & C", "D&E", etc.

If you try to find "A &" or "D&", it is still working.

But once you try "A & B", it will fail. It will only success if you search it as "A & B".

@jochristianto jochristianto changed the title Unable to Find & correctly Unable to Find & (ampersand character) correctly Feb 9, 2017
@Stolzenhain
Copy link

Stolzenhain commented Mar 21, 2023

this relates to #147

Ampersands belong to special HTML chars1, so the item value does not contain & but & as a string value. This might be the reason why A & produces results, whereas & B doesn't.

On my side, this doesn't happen on searches, so there might be further conversions.

Various conversions happen to the strings due to how the values are parsed, see #19 which leads to ampersands being found by searching for amp.

Also note: JS returning things like the value attribute with converted ampersands – whereas the value string in a list.js item keeps the escaped char, making it impossible to compare2.

Footnotes

  1. see: Handlebars Char escaper

  2. it's easier in this case to replace special char in input values like this

    input.value.replace(/&/g, "&")
    

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