HTML entities & and < are not handled correctly

- Instead of using `view.escapeHTML`, just check if todo is blank via RegEx
This commit is contained in:
Nicholas Terwoord 2013-01-27 21:36:34 -05:00
parent 4fea719100
commit bfe85ad6a8

View file

@ -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