Skip to content

Commit

Permalink
Fix regex to detect tasks in notes.
Browse files Browse the repository at this point in the history
  • Loading branch information
elving committed Jun 18, 2014
1 parent 4f5cbe0 commit 3df0a68
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/core/models/note.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = Card.extend({
updateTask: function(index, checked) {
var self = this,
note = this.get('content'),
tasks = note.match(/(\s*\[[x ]\]\s*).+/gm),
tasks = note.match(/(^\-\s*\[[x ]\]\s*).+/gm),
changingTask = tasks[index],
tasksCounter = 0,
originalTask = changingTask;
Expand All @@ -22,7 +22,7 @@ module.exports = Card.extend({
}

this.save({
content: note.replace(/(\s*\[[x ]\]\s*).+/gm, function(match) {
content: note.replace(/(^\-\s*\[[x ]\]\s*).+/gm, function(match) {
if (tasksCounter === index) {
tasksCounter += 1;
return changingTask;
Expand Down

0 comments on commit 3df0a68

Please sign in to comment.