Don't copy search js when disabled

This commit is contained in:
Matt Ickstadt 2018-06-13 14:18:47 -05:00
parent b8011de3e8
commit 62c8311301
1 changed files with 1 additions and 1 deletions

View File

@ -450,7 +450,7 @@ fn make_data(
if cfg!(feature = "search") { if cfg!(feature = "search") {
let search = search.unwrap_or_default(); let search = search.unwrap_or_default();
data.insert("search_enabled".to_owned(), json!(search.enable)); data.insert("search_enabled".to_owned(), json!(search.enable));
data.insert("search_js".to_owned(), json!(search.copy_js)); data.insert("search_js".to_owned(), json!(search.enable && search.copy_js));
} else if search.is_some() { } else if search.is_some() {
warn!("mdBook compiled without search support, ignoring `output.html.search` table"); warn!("mdBook compiled without search support, ignoring `output.html.search` table");
warn!( warn!(