From: Toshi MARUYAMA Date: Tue, 3 Nov 2020 14:55:34 +0000 (+0000) Subject: add empty line after guard clause to SearchHelper X-Git-Tag: 4.2.0~583 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8de9cd47e426fd856c2ab8fac527eea922eba368;p=redmine.git add empty line after guard clause to SearchHelper git-svn-id: http://svn.redmine.org/redmine/trunk@20234 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb index 512482e58..f9f0a73c8 100644 --- a/app/helpers/search_helper.rb +++ b/app/helpers/search_helper.rb @@ -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)