feat(toHighlight): add ignore-accents support - #862
Conversation
|
We are using toLocaleLowerCase at diacritics, we may have some issue without using i18n lang... that method will use browser/navigator locale. For example, having en-US at browser and using some german word. I'm just asking... |
|
@userquin The API concern is real; the German example isn't.
'I'.toLowerCase() // 'i' always
'I'.toLocaleLowerCase('tr') // 'ı' dotless
'İstanbul'.toLowerCase() // 'i̇stanbul' i + combining dot
'İstanbul'.toLocaleLowerCase('tr') // 'istanbul'A This PR inherited Don't thread I'll switch both |
|
Maybe we can use |
'ΣΟΦΟΣ'.toLowerCase() // 'σοφος'
'σοφος'.toUpperCase() // 'ΣΟΦΟΣ'And apparently it is correct, lol |
it looks like |
foldWithMap now runs whenever ignoreCase or target-folding can change length, so İ / İstanbul no longer highlights the following letter. Half of a multi-char fold (s vs ß) expands to the whole source character instead of a zero-width range.
toLocaleLowerCase() followed the host locale, so a tr browser and an en-US browser (or Node vs client) would not highlight the same I/İ/i pairs. Align with createFilter.
Also call the NFD letter map a curated set, and note that createFilter does not fold accents yet.
29f180b to
e599b09
Compare
|
Looking for final comments. |
blocks vuetify#22922