diff --git a/browser/components/MarkdownEditor.js b/browser/components/MarkdownEditor.js index e230eca1..5d716a56 100644 --- a/browser/components/MarkdownEditor.js +++ b/browser/components/MarkdownEditor.js @@ -159,10 +159,10 @@ class MarkdownEditor extends React.Component { e.preventDefault() e.stopPropagation() const idMatch = /checkbox-([0-9]+)/ - const checkedMatch = /^\s*>?\s*[\+\-\*] \[x\]/i - const uncheckedMatch = /^\s*>?\s*[\+\-\*] \[ \]/ - const checkReplace = /\[x\]/i - const uncheckReplace = /\[ \]/ + const checkedMatch = /^\s*>?\s*[+\-*] \[x]/i + const uncheckedMatch = /^\s*>?\s*[+\-*] \[ ]/ + const checkReplace = /\[x]/i + const uncheckReplace = /\[ ]/ if (idMatch.test(e.target.getAttribute('id'))) { const lineIndex = parseInt(e.target.getAttribute('id').match(idMatch)[1], 10) - 1 const lines = this.refs.code.value diff --git a/browser/components/MarkdownSplitEditor.js b/browser/components/MarkdownSplitEditor.js index 39633479..39f98687 100644 --- a/browser/components/MarkdownSplitEditor.js +++ b/browser/components/MarkdownSplitEditor.js @@ -78,10 +78,10 @@ class MarkdownSplitEditor extends React.Component { e.preventDefault() e.stopPropagation() const idMatch = /checkbox-([0-9]+)/ - const checkedMatch = /^\s*>?\s*[\+\-\*] \[x\]/i - const uncheckedMatch = /^\s*>?\s*[\+\-\*] \[ \]/ - const checkReplace = /\[x\]/i - const uncheckReplace = /\[ \]/ + const checkedMatch = /^\s*>?\s*[+\-*] \[x]/i + const uncheckedMatch = /^\s*>?\s*[+\-*] \[ ]/ + const checkReplace = /\[x]/i + const uncheckReplace = /\[ ]/ if (idMatch.test(e.target.getAttribute('id'))) { const lineIndex = parseInt(e.target.getAttribute('id').match(idMatch)[1], 10) - 1 const lines = this.refs.code.value diff --git a/browser/lib/getTodoStatus.js b/browser/lib/getTodoStatus.js index d732ae87..80584d61 100644 --- a/browser/lib/getTodoStatus.js +++ b/browser/lib/getTodoStatus.js @@ -5,10 +5,10 @@ export function getTodoStatus (content) { splitted.forEach((line) => { const trimmedLine = line.trim().replace(/^>\s*/, '') - if (trimmedLine.match(/^[\+\-\*] \[(\s|x)\] ./i)) { + if (trimmedLine.match(/^[+\-*] \[(\s|x)] ./i)) { numberOfTodo++ } - if (trimmedLine.match(/^[\+\-\*] \[x\] ./i)) { + if (trimmedLine.match(/^[+\-*] \[x] ./i)) { numberOfCompletedTodo++ } })