There is a bug in the previous code with Internet Explorer.

To fix it, replace this:

###################
// If its not the last part, add the accented and highlighted term to
the final value
if (n < everything_except_term.length - 1)
{
        // Get the term with the original accentuation and add it highlighted
to the final value
        var termo_local = value.substr(current_position, term.length);
        highlighted_value += "<strong>" + termo_local + "</strong>";

        // Update the current position
        current_position += term.length;
}
###################

With this:

###################
// Get the term with the original accentuation and add it highlighted
to the final value
var term_local = value.substr(current_position, term.length);
highlighted_value += (term_local == '') ? term_local : "<strong>" +
term_local + "</strong>";

// Update the current position
current_position += term.length;
###################

Not as straightforward as the other, but now works in Firefox 3, Opera
9 and Internet Explorer 6 and 7. (I also corrected a typo from the
translation: "termo_local" is actually "term_local").

Also, Jörn (the plugin creator) alerted me that it's not necessary to
change the plugin source code because 'highlight' is an option that
can be overwritten globally or locally. So people interested in this
modification won't have much trouble implementing it.

Reply via email to