From 15fe476a28f907105afd63061050d7c47d7f69f3 Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Mon, 10 May 2021 12:07:55 -0400 Subject: [PATCH] Hotfix: check for site filters before modifying query The previous method of removing all site filters from the search query removed the last letter of the search. This only applies the substring filter if any site filters are present in the query. Fixes #306 --- app/templates/header.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/templates/header.html b/app/templates/header.html index b353d92..50bde42 100644 --- a/app/templates/header.html +++ b/app/templates/header.html @@ -22,7 +22,7 @@ style="background-color: {{ 'var(--whoogle-dark-result-bg)' if config.dark else 'var(--whoogle-result-bg)' }} !important; color: {{ 'var(--whoogle-dark-text)' if config.dark else 'var(--whoogle-text)' }}; type="text" - value="{{ query[:query.find('-site:')] }}"> + value="{{ query[:query.find('-site:')] if '-site:' in query else query }}"> @@ -54,7 +54,7 @@ name="q" spellcheck="false" type="text" - value="{{ query[:query.find('-site:')] }}" + value="{{ query[:query.find('-site:')] if '-site:' in query else query }}" style="background-color: {{ 'var(--whoogle-dark-result-bg)' if config.dark else 'var(--whoogle-result-bg)' }} !important; color: {{ 'var(--whoogle-dark-text)' if config.dark else 'var(--whoogle-text)' }}; border-bottom: {{ '2px solid var(--whoogle-dark-element-bg)' if config.dark else '0px' }};">