question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there an option to ignore accents ? Example:

items: [{name: "Référence"}, {name: "Dénomination}]

If I search for reference, it won’t find Référence

Is this already possible?

Nb: it does work if you only have those two options, but with a large amount, it doesn’t.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:10
  • Comments:6

github_iconTop GitHub Comments

11reactions
marciovsenacommented, Aug 23, 2018

I solved this:

const removeSpecialCharacters = str => {
  return str.normalize('NFD').replace(/[\u0300-\u036f]/g, '')
}
const list = suggestions.map(suggestion => ({
  value: suggestion.value,
  noSpecialCharacters: removeSpecialCharacters(suggestion.value)
}))

let opts = {
  keys: ['value', 'noSpecialCharacters']
  ...
}

but I agree it could be a parameter. I will try to contribute to this if it is in your interest.

8reactions
MatthiasRMScommented, Aug 6, 2017

@robozevel thanks for the advice, I can indeed to this! However, wouldn’t it be nice to have this built in ?

I’d be happy to work on this and make a PR. @krisk would you accept a PR to add an option ignoring diacritics ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Ignoring accented letters in string comparison
I need to compare 2 strings in C# and treat accented letters the same as non-accented letters. For example ...
Read more >
Making searches ignore accented characters
This way, users can search for both accented and unaccented characters and Index ... You can, however, make Index Manager ignore accents:.
Read more >
Ignoring Accented Characters in Searches - Microsoft Word Tips
Sue is wondering if Word can perform "accent insensitive" searches. The short answer is no, it cannot. The reason is simple: Word searches...
Read more >
Ignore accents in browser search
Ignore accents and diacritical marks used by various languages when searching in the card browser and match only against the base characters ...
Read more >
sql server - Ignore accents in 'where' clause
This problem can be solved using accent insensitive collations. Your database is probably using a AS (Accent Sensitive) collation so by ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found