[mod] internal ! and external !! bangs: ignore upper/lower case

Closes: https://github.com/searxng/searxng/issues/1223

Suggested-by: @dalf https://github.com/searxng/searxng/issues/1223#issuecomment-1133772363
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2025-04-24 10:20:20 +02:00 committed by Markus Heiser
parent d19eb3903e
commit c6c6d3027c

View File

@ -155,7 +155,7 @@ class ExternalBangParser(QueryPartParser):
return raw_value.startswith('!!') and len(raw_value) > 2
def __call__(self, raw_value):
value = raw_value[2:]
value = raw_value[2:].lower()
found, bang_ac_list = self._parse(value) if len(value) > 0 else (False, [])
if self.enable_autocomplete:
self._autocomplete(bang_ac_list)
@ -183,7 +183,7 @@ class BangParser(QueryPartParser):
return raw_value[0] == '!' and (len(raw_value) < 2 or raw_value[1] != '!')
def __call__(self, raw_value):
value = raw_value[1:].replace('-', ' ').replace('_', ' ')
value = raw_value[1:].replace('-', ' ').replace('_', ' ').lower()
found = self._parse(value) if len(value) > 0 else False
if found and raw_value[0] == '!':
self.raw_text_query.specific = True