aboutsummaryrefslogtreecommitdiffstats
path: root/todolist/parser.go
diff options
context:
space:
mode:
authorQuey-Liang Kao <s101062801@m101.nthu.edu.tw>2017-09-13 02:12:46 -0500
committerGitHub <noreply@github.com>2017-09-13 02:12:46 -0500
commit06211d84da190ab9a5e174db9f52672b69f9b3e4 (patch)
tree2b614952391eff191ee4e29e93fffc6837a042ed /todolist/parser.go
parent10c18a4c528e3d7389dddb90f54ed5571c0d242a (diff)
parent0c2a2f99a9cdcc9acb7d55807330801d58d4c632 (diff)
Merge pull request #93 from NonerKao/bug_add_empty_todo
Fix a bug in ParseNewTodo()
Diffstat (limited to 'todolist/parser.go')
-rw-r--r--todolist/parser.go2
1 files changed, 1 insertions, 1 deletions
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