summaryrefslogtreecommitdiff
path: root/add.go
diff options
context:
space:
mode:
authorDavid Schlachter <t480-debian-git@schlachter.ca>2026-01-09 00:06:43 -0500
committerDavid Schlachter <t480-debian-git@schlachter.ca>2026-01-09 00:06:43 -0500
commitb390b93e1c86f90c9044323d6a4fa7f59bafc4f0 (patch)
treee9a9036af4eead3872ac3dfc9d3d8457cdd291de /add.go
parent1a3cba38218d5652be1d8c1d4b165bf980c97831 (diff)
Ignore whitespace in lookups and new cards
Diffstat (limited to 'add.go')
-rw-r--r--add.go2
1 files changed, 2 insertions, 0 deletions
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"))
}