Recently I was working on automating some legislation tracking tasks for the UC Davis Legislative Affairs Committee and noticed a potential bug in displaying the results of bill information searches and wanted to note it.

If you are interested in California legislation you can go to the state website and search for bills by a number of parameters, including by keywords.

Which brings up a number of bills. Clicking on one gives us the bill’s full text with out keyword highlighted.

The bug occurs when we search for specific html tags like div or span.

When these terms are searched the source html ends up being rendered on the actual page with tags highlighted.

Looking at the actual html at locations where this occurs it looks like the highlighting is resulting in unescaped < characters.

<div style="margin:0 0 1em 0"><<b><span style='background-color:yellow'>span</span></b>
</<b><span style='background-color:yellow'>span</span></b>><<b><span style='background-color:yellow'>span</span></b>

This bug seems to basically be an aesthetics issues and may confuse a user or two who’s search terms overlap with html tags but that is about it. I opened an issue on the state website to inform the web administrator.