todotxt / todo.txt

‼️ A complete primer on the whys and hows of todo.txt.
GNU General Public License v3.0
2.33k stars 102 forks source link

todotxt.js - TodoList.prototype.checkTerm logic is faulty #32

Closed arprice102 closed 4 years ago

arprice102 commented 4 years ago

Towards the end of the function on line 677, the if statement reads:

if (!case_sensitive) { res = (task.text.indexOf(term) === -1) ? not : !not; } else { res = (task.text.toLocaleLowerCase().indexOf(term.toLocaleLowerCase()) === -1) ? not : !not; }

It should actually read if(case_sensitive) - drop the !

You only want to convert to lower case if case_sensitive = false.

karbassi commented 4 years ago

Hello @arprice102

Do you mean to submit this issue to https://github.com/roufamatic/todo-txt-js or https://github.com/rmasters/todotxt.js or https://github.com/jmhobbs/jsTodoTxt ?

This repository is for the todo.txt spec only.