From f9a98c7aa2d92b931c2ce34d188d9be390f4e2dc Mon Sep 17 00:00:00 2001 From: Quey-Liang Kao Date: Sun, 20 Aug 2017 23:04:29 +0800 Subject: Fix a bug in ParseNewTodo() The new pattern now does not allow empty todos to be added as "a" or "add" strings. --- todolist/parser.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'todolist/parser.go') diff --git a/todolist/parser.go b/todolist/parser.go index cdfb179..d62c77d 100644 --- a/todolist/parser.go +++ b/todolist/parser.go @@ -12,7 +12,7 @@ import ( type Parser struct{} func (p *Parser) ParseNewTodo(input string) *Todo { - r, _ := regexp.Compile(`^(add|a)(\\ |) `) + r, _ := regexp.Compile(`^(add|a)(\s*|)`) input = r.ReplaceAllString(input, "") if input == "" { return nil -- cgit v1.3