1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-23 00:41:14 +00:00

add empty line after guard clause to SearchHelper

git-svn-id: http://svn.redmine.org/redmine/trunk@20234 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2020-11-03 14:55:34 +00:00
parent 5f8d73108e
commit 8de9cd47e4

View File

@ -20,6 +20,7 @@
module SearchHelper
def highlight_tokens(text, tokens)
return text unless text && tokens && !tokens.empty?
re_tokens = tokens.collect {|t| Regexp.escape(t)}
regexp = Regexp.new "(#{re_tokens.join('|')})", Regexp::IGNORECASE
result = +''
@ -58,6 +59,7 @@ module SearchHelper
results_by_type.keys.sort_by {|k| results_by_type[k]}.reverse_each do |t|
c = results_by_type[t]
next if c == 0
text = "#{type_label(t)} (#{c})"
links << link_to(h(text), :q => params[:q], :titles_only => params[:titles_only],
:all_words => params[:all_words], :scope => params[:scope], t => 1)