standardnotes / simple-task-editor

[Moved to https://github.com/standardnotes/app]
GNU Affero General Public License v3.0
11 stars 20 forks source link

Allow capital X to be recognized as completed prefix #13

Open kyletolle opened 5 years ago

kyletolle commented 5 years ago

I see that only a lower x is allowed for the completed prefix, - [x], which is defined at https://github.com/sn-extensions/simple-task-editor/blob/master/app/models/Task.js#L4

Would also be nice for capital X, - [X], to be a possible completed prefix too, at least for initially parsing the list.

If I start with this plain text:

- [X] spec/models/some_file.rb
- [X] spec/models/some_file_here_is_okay.rb
- [ ] spec/models/some_file_here_too.rb
- [ ] spec/models/some_file_.rb
- [X] spec/models/some_file_here_is_okay.rb
- [ ] spec/models/some_file_here_too.rb
- [ ] spec/models/some_file.rb
- [X] spec/models/some_file_here_is_okay.rb
- [ ] spec/models/some_file_here_too.rb
- [ ] spec/models/some_file.rb
- [X] spec/models/some_file_here_is_okay.rb
- [ ] spec/models/some_file_here_too.rb
- [ ] spec/models/some_file.rb

And use the Simple Task Editor, I get this: bad tasks

moughxyz commented 5 years ago

Could be done I suppose. But how did you end up here? Were you importing these tasks from somewhere else?

kyletolle commented 5 years ago

I've used plain-text TODOs for a while, especially when I have TODOs sprinkled through prose. And I for whatever reason always used - [X]. While I was playing around with SN features, I had a note using the - [X] convention and when I turned on the simple task editor, it created the above output. That was surprising.

I just did some testing with GitHub and it appears they use - [x] when you check off a todo from a comment or PR. So maybe I'm just the oddball for using a capital X.

moughxyz commented 5 years ago

Yeah, the lowercase x was inspired from GitHub's Markdown. Although they seem to recognize capital as well.