mirror of
https://github.com/git/git.git
synced 2025-01-27 09:53:42 +08:00
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>
This commit is contained in:
parent
337da8d2b0
commit
07a40062ae
@ -5400,7 +5400,9 @@ sub git_project_list_rows {
|
||||
print "</td>\n";
|
||||
}
|
||||
print "<td>" . $cgi->a({-href => href(project=>$pr->{'path'}, action=>"summary"),
|
||||
-class => "list"}, esc_html($pr->{'path'})) . "</td>\n" .
|
||||
-class => "list"},
|
||||
esc_html_match_hl($pr->{'path'}, $search_regexp)) .
|
||||
"</td>\n" .
|
||||
"<td>" . $cgi->a({-href => href(project=>$pr->{'path'}, action=>"summary"),
|
||||
-class => "list", -title => $pr->{'descr_long'}},
|
||||
esc_html($pr->{'descr'})) . "</td>\n" .
|
||||
|
Loading…
Reference in New Issue
Block a user