* @param repository\r
* the repository object\r
*/\r
- protected void index(RepositoryModel model, Repository repository) {\r
+ private void index(RepositoryModel model, Repository repository) {\r
try {\r
if (shouldReindex(repository)) {\r
// (re)build the entire index\r
* @return tree\r
* @throws IOException\r
*/\r
- protected RevTree getTree(final RevWalk walk, final RevCommit commit)\r
+ private RevTree getTree(final RevWalk walk, final RevCommit commit)\r
throws IOException {\r
final RevTree tree = commit.getTree();\r
if (tree != null) {\r
* @param repository\r
* @return true of the on-disk index format is different than INDEX_VERSION\r
*/\r
- protected boolean shouldReindex(Repository repository) {\r
+ private boolean shouldReindex(Repository repository) {\r
try {\r
FileBasedConfig config = getConfig(repository);\r
config.load();\r
* @param repository\r
* @return IndexResult\r
*/\r
- protected IndexResult updateIndex(RepositoryModel model, Repository repository) {\r
+ private IndexResult updateIndex(RepositoryModel model, Repository repository) {\r
IndexResult result = new IndexResult();\r
try {\r
FileBasedConfig config = getConfig(repository);\r
Fragmenter fragmenter = new SimpleSpanFragmenter(scorer, fragmentLength); \r
\r
// use an artificial delimiter for the token\r
- String termTag = "<!--[";\r
- String termTagEnd = "]-->";\r
+ String termTag = "!!--[";\r
+ String termTagEnd = "]--!!";\r
SimpleHTMLFormatter formatter = new SimpleHTMLFormatter(termTag, termTagEnd);\r
Highlighter highlighter = new Highlighter(formatter, scorer); \r
highlighter.setTextFragmenter(fragmenter);\r
sb.append(tag);\r
\r
// replace the artificial delimiter with html tags\r
- String html = fragment.replace(termTag, "<span class=\"highlight\">").replace(termTagEnd, "</span>");\r
+ String html = StringUtils.escapeForHtml(fragment, false);\r
+ html = html.replace(termTag, "<span class=\"highlight\">").replace(termTagEnd, "</span>");\r
sb.append(html);\r
sb.append("</pre>");\r
if (i < len - 1) {\r