Currently I am using this script (http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html) on my website - www.tompainetoday.com.
It works when you hover your mouse over a "Trending Now:" term, then that word is highlighted throughout the page. The highlighting is removed when you hover over the header image (yes, I know, poor UX, but it works).
The problem arrises when the trending word is short, and ends up being highlighted inside of other, larger words, since this script makes no distinction between words and a list of characters.
Basically, I think this can be done rather easily by only highlighting the characters if the character prior and after the word are not a letter.
I tweeted the developer of this script and suggested it be edited with:new RegExp("\W" + pat + "\W").test
I have no experience with regex, and only minimal with JavaScript.
Any help in fixing this out would be much apprecaited!
Thanks!