Replace all spaces in searched title
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Peter Stuifzand 2020-05-26 23:04:18 +02:00
parent b4f114c037
commit 8e7da9b4d4

View File

@ -111,7 +111,7 @@ search(searchInput).then(searcher => {
} }
$('#autocomplete').show() $('#autocomplete').show()
let result = searcher.search(query) let result = searcher.search(query)
const newpage = query.replace(' ', '_') const newpage = query.replace(/\s+/g, '_')
var template = document.getElementById('result-template').innerHTML; var template = document.getElementById('result-template').innerHTML;
var rendered = Mustache.render(template, {page: newpage, results: result}, {}, ['[[', ']]']); var rendered = Mustache.render(template, {page: newpage, results: result}, {}, ['[[', ']]']);
let autocomplete = document.getElementById('autocomplete'); let autocomplete = document.getElementById('autocomplete');