Hi
you r right in this:
SuggestionTools.SerializeValueToJson(sb, "Description", SuggestionTools.HighLight(Description, tryValue)).Append(",")
it uses
this code to highlight:
Code:
public static string HighLight(string text, string value)
{
Regex regex = new Regex("\\s(" + value + ")|^(" + value + ")",
RegexOptions.Compiled | RegexOptions.IgnoreCase);
return regex.Replace(text, new MatchEvaluator(MatchEval));
}
private static string MatchEval(Match match) {
return "<span class=\"hilighted\">" + match.ToString() + "</span>";
}
the regexp pattern matches all words starting with a white space or begining of the line.
umm actually I just realized that the passed value could contain special pattern chars and the method will not work as it should.
so check if your tryValue is alfa-numeric
You can create your own method to highlight just wrap the text you want to highlight with
<span class=\"hilighted\">highlighted text here</span>Thanks