On Mon, Feb 9, 2009 at 2:59 PM, Jeffrey Baker <jwba...@gmail.com> wrote: > The default highlighter output is bogus if you're trying to use the > snippets in a web browser. With the default <em></em> delimiters, the > temptation is to just stick the snippets in an innerHTML property, but > the problem is that other HTML special characters (< > and &) are not > escaped. For example, a highlight snippet might look like this: > > "<em>this</em> & that"
So, there's a "SimpleHTMLEncoder" in Lucene (also included in the Solr distribution) and that could be of use here. When highlightTerm is called, SimpleHTMLFormatter would run the text through SimpleHTMLEncoder this naturally is going to result in some extra garbage generation. Is there any better place to put it? -jwb