Мой код:
jQuery.fn.extend({
highlight: function(search){
var regex = new RegExp('(<[^>]*>)|('+ search.replace(/[.+]i/,"$0") +')','ig');
return this.html(this.html().replace(regex, function(a, b, c){
return (a.charAt(0) == '<') ? a : '<strong class="highlight">' + c + '</strong>';
}));
}
});
Я хочу выделять буквы акцентами, например:
$('body').highlight("cao");
должен выделить: [ção] OR [çÃo] OR [cáo] OR expre [cão ]tion OR [Cáo ]tion
Как я могу это сделать?