Improved the list of forked repositories presentation.

This commit is contained in:
takezoe
2013-08-10 04:21:31 +09:00
parent f3a1815bc5
commit 03e903eef9
5 changed files with 30 additions and 4 deletions

View File

@@ -97,7 +97,7 @@ object RepositorySearchService {
val lineNumber = content.substring(0, indices.min).split("\n").size - 1
val highlightText = StringUtil.escapeHtml(content.split("\n").drop(lineNumber).take(5).mkString("\n"))
.replaceAll("(?i)(" + keywords.map("\\Q" + _ + "\\E").mkString("|") + ")",
"<span style=\"background-color: #ffff88;;\">$1</span>")
"<span class=\"highlight\">$1</span>")
(highlightText, lineNumber + 1)
} else {
(content.split("\n").take(5).mkString("\n"), 1)