I'm using the jquery.highlight plugin: http://code.google.com/p/gce-empire/source/browse/trunk/jquery.highlight.js?r=2
I'm using it to highlight search results.
The problem is that if I search something like "café" it won't highlight any words.
And if I search "cafe", even though my results contains both "cafe" & "café", it will only highlight "cafe".
So, I would need to highlight all "versions" of the words, with or without diacritics.
Is that possible?
http://jsfiddle.net/nHGU6/
Test HTML:
<div id="wrapper-accent-sensitive"> <p>cafe</p> <p>asdf</p> <p>café</p> </div> <hr /> <div id="wrapper-not-accent-sensitive">> <p>cafe</p> <p>asdf</p> <p>café</p> </div>
Test CSS:
.yellow { background-color: #ffff00; }
Replacement Javascript:
Test code:
$(document).ready(function() { $("#wrapper-accent-sensitive").highlight("cafe", { className: 'yellow' }); $("#wrapper-not-accent-sensitive").highlight("cafe", { className: 'yellow', accentInsensitive: true }); });