From 62c83113014624680a3b80a43992aebcb0f52086 Mon Sep 17 00:00:00 2001 From: Matt Ickstadt Date: Wed, 13 Jun 2018 14:18:47 -0500 Subject: [PATCH] Don't copy search js when disabled --- src/renderer/html_handlebars/hbs_renderer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/html_handlebars/hbs_renderer.rs b/src/renderer/html_handlebars/hbs_renderer.rs index 52e58f81..45cb052a 100644 --- a/src/renderer/html_handlebars/hbs_renderer.rs +++ b/src/renderer/html_handlebars/hbs_renderer.rs @@ -450,7 +450,7 @@ fn make_data( if cfg!(feature = "search") { let search = search.unwrap_or_default(); 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() { warn!("mdBook compiled without search support, ignoring `output.html.search` table"); warn!(