I have a micro-mini search engine that highlights search terms in my rails application. The search ignores accents and the highlight is case insensitive. Almost perfect. But, for example, if I have a record with the text "pão de queijo" and I search for "pao de queijo", the recordwill return, but the iext icon is not . Similarly, if I search for "pÃo de queijo", the record is returned, but not highlighted properly.
My code is as simple as:
<%= highlight(result_pessoa.observacoes, search_string, '<span style="background-color: yellow;">\1</span>') %>
source
share