feat(ods): trim spaces around the searched word

This commit is contained in:
Julien Dessaux 2024-03-26 21:11:29 +01:00
parent 4c9b51b8c6
commit e389a0e925
Signed by: adyxax
GPG key ID: F92E51B86E07177E

View file

@ -51,7 +51,7 @@ func postIndex() http.Handler {
Query: r.FormValue("query"),
Invalid: true,
}
query := strings.ToUpper(data.Query)
query := strings.TrimSpace(strings.ToUpper(data.Query))
for _, w := range words {
if w == query {
data.Invalid = false