Skip to content

Commit 91b5398

Browse files
authored
Merge pull request #2307 from modmod24/fix-todo-percentage
update todo percentage correctly #2267
2 parents eeb8016 + df4d837 commit 91b5398

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

browser/lib/getTodoStatus.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ export function getTodoStatus (content) {
55

66
splitted.forEach((line) => {
77
const trimmedLine = line.trim()
8-
if (trimmedLine.match(/^[\+\-\*] \[(\s|x)\] ./)) {
8+
if (trimmedLine.match(/^[\+\-\*] \[(\s|x)\] ./i)) {
99
numberOfTodo++
1010
}
11-
if (trimmedLine.match(/^[\+\-\*] \[x\] ./)) {
11+
if (trimmedLine.match(/^[\+\-\*] \[x\] ./i)) {
1212
numberOfCompletedTodo++
1313
}
1414
})

tests/lib/get-todo-status-test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ test('getTodoStatus should return a correct hash object', t => {
1212
['- [ ] a\n- [x] a\n', { total: 2, completed: 1 }],
1313
['+ [ ] a\n', { total: 1, completed: 0 }],
1414
['+ [ ] a\n+ [x] a\n', { total: 2, completed: 1 }],
15+
['+ [ ] a\n+ [X] a\n', { total: 2, completed: 1 }],
1516
['+ [ ] a\n+ [testx] a\n', { total: 1, completed: 0 }],
1617
['+ [ ] a\n+ [xtest] a\n', { total: 1, completed: 0 }],
1718
['+ [ ] a\n+ foo[x]bar a\n', { total: 1, completed: 0 }],

0 commit comments

Comments
 (0)