summaryrefslogtreecommitdiff
path: root/ui.go
diff options
context:
space:
mode:
Diffstat (limited to 'ui.go')
-rw-r--r--ui.go3
1 files changed, 3 insertions, 0 deletions
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) {