I'm trying to mimic the way that Google displays related search results.
Suppose I've searched for "widgets".
In the related terms Google presents, all words, except the search term are made bold.
The way they do it is to append the other bits with a <b>
tag.
Here are some examples based on the search term widgets:
Term: blue widgets
<b>blue</b> widgets
Result: blue widgets
Term: widgets for cars
widgets <b>for cars</b>
Result: widgets for cars
Term: big widgets for real men with a love for widgets
<b>big</b widgets <b>for real men with a love for</b> widgets
Result: big widgets for real men with a love for widgets
I'm working in Asp.Net c#, and there's no reason why this shouldn't be done in code, not javascript - the issue is I can't think of a way to approach it!
Anyone done anything like this before and can offer some advice?
Thanks on advance.