From b390b93e1c86f90c9044323d6a4fa7f59bafc4f0 Mon Sep 17 00:00:00 2001 From: David Schlachter Date: Fri, 9 Jan 2026 00:06:43 -0500 Subject: Ignore whitespace in lookups and new cards --- add.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'add.go') diff --git a/add.go b/add.go index 5116c86..9d25288 100644 --- a/add.go +++ b/add.go @@ -7,6 +7,7 @@ import ( "fmt" "io" "net/http" + "strings" tea "github.com/charmbracelet/bubbletea" ) @@ -43,6 +44,7 @@ type options struct { func addCard(c *http.Client, apiURL, deckName, modelName, front, back string) tea.Cmd { return func() tea.Msg { + front = strings.TrimSpace(front) if back == "" { return errMsg(errors.New("definition is blank")) } -- cgit v1.2.3