-
Notifications
You must be signed in to change notification settings - Fork 158
Open
Description
I'd love for accent insensitive highlighting to be baked in the same way case insensitivity is. I'm currently using the following for French, and I'm not sure how it would generalize:
highlighter: function(item) {
var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&');
// French accent insensitivity
// ---------------------------------------
query = query.replace(/a/i, '[aáÁàÀâÂäÄ]');
query = query.replace(/e/i, '[eéÉèÈêÊëË]');
query = query.replace(/i/i, '[iíÍìÌîÎïÏ]');
query = query.replace(/o/i, '[oóÓòÒôÔöÖ]');
query = query.replace(/u/i, '[uúÚùÙûÛüÜ]');
query = query.replace(/c/i, '[cçÇ]');
// ----------------------------------------
return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
return '<strong>' + match + '</strong>';
});
}Metadata
Metadata
Assignees
Labels
No labels