The query selector here:
searchForm.addEventListener('submit', function (e) {
e.preventDefault()
if (searchList.querySelector('[value=' + searchInput.value + ']')) {
document.location.href = '/view/' + searchInput.value
} else {
document.location.href = '/wiki/search?pattern=' + searchInput.value
}
})
doesn't cope with spaces in the search term