From 62e1896caf091622cf6b56eb14ba5591155ac567 Mon Sep 17 00:00:00 2001 From: David Schlachter Date: Sun, 11 Jan 2026 14:10:17 -0500 Subject: Clean apostrophes in user input as well --- ui.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui.go b/ui.go index bbffb5c..dada7c6 100644 --- a/ui.go +++ b/ui.go @@ -87,6 +87,9 @@ func (m model) Init() tea.Cmd { func lookupWord(db *sql.DB, word string) tea.Cmd { return func() tea.Msg { word = strings.TrimSpace(word) // remove leading / trailing whitespace + // Replace apostrophes (possible if copy-pasting) with single quotes + word = strings.ReplaceAll(word, `’`, `'`) + rows, err := db.Query(`select definition from words where word = ?`, word) if err != nil { if errors.Is(err, sql.ErrNoRows) { -- cgit v1.2.3