Skip to content

Commit

Permalink
Set tokenizer_separator to nil by default, add a check for not nil an…
Browse files Browse the repository at this point in the history
…d not blank to prevent breaking search
  • Loading branch information
lewisnyman committed Aug 2, 2018
1 parent f9d262d commit 50d0723
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/middleman-search/extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class SearchExtension < Middleman::Extension
option :index_path, 'search.json', 'Index file path'
option :pipeline, {}, 'Javascript pipeline functions to use in lunr index'
option :pipeline_remove, {}, 'Default pipeline functions to remove'
option :tokenizer_separator, {}, 'Replace the default tokizer separator'
option :tokenizer_separator, nil, 'Replace the default tokizer separator'
option :cache, false, 'Avoid the cache to be rebuilt on every request in development mode'
option :language, 'en', 'Language code ("es", "fr") to use when indexing site\'s content'
option :lunr_dirs, [], 'Directories in which to look for custom lunr.js files'
Expand Down
2 changes: 1 addition & 1 deletion lib/middleman-search/search-index-resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def build_index
source << "this.pipeline.add(lunr.Pipeline.registeredFunctions.#{name});"
end

if @tokenizer_separator.nil?
if @tokenizer_separator.present?
source << "this.tokenizerFn.seperator = #{@tokenizer_separator}"
end

Expand Down

0 comments on commit 50d0723

Please sign in to comment.