diff options
-rw-r--r-- | .rubocop_todo.yml | 1 | ||||
-rw-r--r-- | lib/redmine/search.rb | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index b6f59ffcf..424e7ffcb 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -992,7 +992,6 @@ Style/AndOr: Style/AsciiComments: Exclude: - 'app/models/repository/git.rb' - - 'lib/redmine/search.rb' # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. diff --git a/lib/redmine/search.rb b/lib/redmine/search.rb index 0f80c8908..17968e959 100644 --- a/lib/redmine/search.rb +++ b/lib/redmine/search.rb @@ -62,7 +62,7 @@ module Redmine # eg. hello "bye bye" => ["hello", "bye bye"] @tokens = @question.scan(%r{((\s|^)"[^"]+"(\s|$)|\S+)}).collect {|m| m.first.gsub(%r{(^\s*"\s*|\s*"\s*$)}, '')} # tokens must be at least 2 characters long - # but for Chinese characters (汉字/漢字), tokens can be one character + # but for Chinese characters (Chinese HANZI/Japanese KANJI), tokens can be one character @tokens = @tokens.uniq.select {|w| w.length > 1 || w =~ /\p{Han}/ } # no more than 5 tokens to search for @tokens.slice! 5..-1 |