gitweb: Highlight matched part of project name when searching projects

Use esc_html_match_hl() introduced in previous commit to escape HTML and mark match, using span element with 'match' class. Currently only the 'path' part (i.e. the project name) is highlighted; match might be on the project description. Highlighting match in description is left for next commit. The code makes use of the fact that defined $search_regexp means that there was search going on. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jakub Narebski committed Feb 27, 2012 at 02:55 UTC 07a40062aebc184f5aa1d6750fe80ab6fe120cc8
1 file changed +3 -1
gitweb/gitweb.perl
+3 -1
@@ -5400,7 +5400,9 @@ sub git_project_list_rows {
5400 print "</td>\n";
5401 }
5402 print "<td>" . $cgi->a({-href => href(project=>$pr->{'path'}, action=>"summary"),
5403 - -class => "list"}, esc_html($pr->{'path'})) . "</td>\n" .
5403 + -class => "list"},
5404 + esc_html_match_hl($pr->{'path'}, $search_regexp)) .
5405 + "</td>\n" .
5406 "<td>" . $cgi->a({-href => href(project=>$pr->{'path'}, action=>"summary"),
5407 -class => "list", -title => $pr->{'descr_long'}},
5408 esc_html($pr->{'descr'})) . "</td>\n" .