From 8e7da9b4d40a972a173aff6e40dc097f6bc7e11a Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Tue, 26 May 2020 23:04:18 +0200 Subject: [PATCH] Replace all spaces in searched title --- editor/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/src/index.js b/editor/src/index.js index abf5255..955e424 100644 --- a/editor/src/index.js +++ b/editor/src/index.js @@ -111,7 +111,7 @@ search(searchInput).then(searcher => { } $('#autocomplete').show() let result = searcher.search(query) - const newpage = query.replace(' ', '_') + const newpage = query.replace(/\s+/g, '_') var template = document.getElementById('result-template').innerHTML; var rendered = Mustache.render(template, {page: newpage, results: result}, {}, ['[[', ']]']); let autocomplete = document.getElementById('autocomplete');