I suspect the line-breaks are broken by the strip_tags() call being done on line 70 ... and the strip_tags are probably there to remove HTML that might otherwise break the DOM/layout in the results list. You could probably do a str_replace() for all '<br />' to "\n" before the strip_tags, and then do another str_replace to change the \n back to br again after the strip_tags. Or maybe use something other than a br tag if all you need is "space".
Just a guess.
It would be bad if the text contained any malformed HTML which ought not to be inside an <a> or <li> tag, especially any improperly closed </li> or </ul> or </a> tags.
And for the lowercase bit, again I'm guessing, but maybe it's the highlightWord function in the instantSearch.js that's causing it.
Line 113 of that file says this:
Code:
resultHtml += '<li><a href="' + generateLink(item.pc,item.l) + '"><span class="alignRight">' + formatNumber(item.c) + '</span>' + highlightWord(replaceWord,item.q) + '</a></li>';
I'm guessing that maybe skipping the highlightWord call might leave the case alone:
Code:
resultHtml += '<li><a href="' + generateLink(item.pc,item.l) + '"><span class="alignRight">' + formatNumber(item.c) + '</span>' + item.q + '</a></li>';