Search term highlighting
I added a regular expression to highlight search terms in matching entries, in the style of Google’s cache. This is a nice thing, if a bit poncey. It has a known issue that it will match text in a tag.
E.g. a search for hypothetical will replace all instances of hypothetical with <span style="background-color:#9f0;">hypothetical</span>
. If there is a link to hype it will go from:
<a href="http://hypothetical.co.uk/">hype!</a>
to
<a href="http://<span style="background-color:#9f0;">hypothetical</span>.co.uk/">hype!</a>
Which isn’t valid HTML and will snap browsers like a twig. Well, nearly.