From bfe85ad6a8d08538bf11b14e7aa321bdac0faf63 Mon Sep 17 00:00:00 2001 From: Nicholas Terwoord Date: Sun, 27 Jan 2013 21:36:34 -0500 Subject: [PATCH] HTML entities & and < are not handled correctly - Instead of using `view.escapeHTML`, just check if todo is blank via RegEx --- src/app/index.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/index.coffee b/src/app/index.coffee index 9d59ab1499..3f39d87e91 100644 --- a/src/app/index.coffee +++ b/src/app/index.coffee @@ -162,8 +162,10 @@ ready (model) -> type = $(el).attr('data-task-type') list = model.at "_#{type}List" newModel = model.at('_new' + type.charAt(0).toUpperCase() + type.slice(1)) + text = newModel.get() # Don't add a blank todo - return unless text = view.escapeHtml newModel.get() + return if /^(\s)*$/.test(text) + newModel.set '' switch type