From 60981bc18d2808dcd9f1abaa007443ba8e1e2110 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Mon, 13 Nov 2023 20:20:27 +0000 Subject: [PATCH] Fix --- src/packages/index.gleam | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/packages/index.gleam b/src/packages/index.gleam index ff01ae1..0ff4a98 100644 --- a/src/packages/index.gleam +++ b/src/packages/index.gleam @@ -404,7 +404,11 @@ pub fn search_packages( // In future it would be good to build more sophisticated queries, but for now // we just escape it to avoid syntax errors. fn webquery_to_sqlite_fts_query(webquery: String) -> String { - "\"" <> string.replace(webquery, "\"", "\"\"") <> "\"" + let webquery = string.trim(webquery) + case webquery { + "" -> "" + _ -> "\"" <> string.replace(webquery, "\"", "\"\"") <> "\"" + } } fn unix_timestamp(data: Dynamic) -> Result(DateTime, List(DecodeError)) {