I'm trying to make my site search highlight keywords in the search results, similar to the groups.google.com search. However, I only want to highlight these keywords if they are not in an HTML tag (like an href or a CSS style).
Here's my current (quite elementary) code:
$newline =~ s|\b$keyword\b|<font style="BACKGROUND: #ffffff">$keyword</font>|img;
I'm looking for the optimal solution, but my brain doesn't want to work today. Any ideas?