ignore case when matching bangs
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Simon Bruder 2019-05-30 19:04:16 +00:00
parent 896e270847
commit f6d3df8420
No known key found for this signature in database
GPG key ID: 6F03E0000CC5B62F

View file

@ -56,9 +56,13 @@ func parseBang(searchQuery string) (bang string, query string) {
endBang := regexEndBang.FindSubmatch([]byte(searchQuery)) endBang := regexEndBang.FindSubmatch([]byte(searchQuery))
if len(endBang) == 3 { if len(endBang) == 3 {
return string(endBang[2]), string(endBang[1]) bang = strings.ToLower(string(endBang[2]))
query = string(endBang[1])
return
} else if len(startBang) == 3 { } else if len(startBang) == 3 {
return string(startBang[1]), string(startBang[2]) bang = strings.ToLower(string(startBang[1]))
query = string(startBang[2])
return
} else { } else {
return "", searchQuery return "", searchQuery
} }