-
Notifications
You must be signed in to change notification settings - Fork 332
Open
Description
Hi Algolia team 👋
I'm using @algolia/autocomplete-js
together with these plugins:
@algolia/autocomplete-plugin-query-suggestions
@algolia/autocomplete-plugin-recent-searches
I've encountered an issue where highlighting with fails to wrap matched parts when using Cyrillic characters (e.g. Ukrainian or Russian). For Latin characters, everything works fine — matches are wrapped and highlighted as expected.
🧪 Observations
- Queries are correctly matched — verified in logs.
- However,
<components.ReverseHighlight>
doesn't wrap Cyrillic matches in highlighting tags. - Replacing with
<components.Highlight>
resolves the issue.
✅ Temporary Workaround
// Before:
<components.ReverseHighlight hit={item} attribute="query" />
// replaced with:
<components.Highlight hit={item} attribute="query" />
<components.ReverseHighlight hit={item} attribute="label" />
// replaced with:
<components.Highlight hit={item} attribute="label" />
Expected Behavior
should correctly highlight substrings in Cyrillic scripts.
###💡 Possible Fix
It seems related to Unicode-aware string matching or regex. Enhancing ReverseHighlight to support non-Latin alphabets—or documenting that Highlight is preferred for such cases—would be valuable.
Thanks for maintaining Autocomplete — it’s a fantastic tool!
Sources:
Metadata
Metadata
Assignees
Labels
No labels