diff options
| author | David Schlachter <t480-debian-git@schlachter.ca> | 2026-01-11 14:10:17 -0500 |
|---|---|---|
| committer | David Schlachter <t480-debian-git@schlachter.ca> | 2026-01-11 14:10:17 -0500 |
| commit | 62e1896caf091622cf6b56eb14ba5591155ac567 (patch) | |
| tree | 03cd95b10d1ccc7c03a0e1c63ada3d256162913b /ui.go | |
| parent | 53c51980818258036297986ef3d315c0009ead91 (diff) | |
Clean apostrophes in user input as well
Diffstat (limited to 'ui.go')
| -rw-r--r-- | ui.go | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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) { |
