Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writing a word ending with "x" between brackets counts as a Checkbox #1280

Closed
Romsick opened this issue Dec 11, 2017 · 1 comment
Closed

Comments

@Romsick
Copy link

Romsick commented Dec 11, 2017

Bug

Whenever you write "[max]" or any word ending with the "x" character (without the quotes) followed by a whitespace and any word/character, Boostnote interprets it as a checkbox, also inside code blocks.

The checkbox counter and the completion bar show there are uncompleted checkboxes in the note. But these aren't checkboxes and at the same time, the box to mark it as complete never appears in this cases.

boostnote_checkbox_issue

To reproduce

Paste or write the following in a Markdown Note:

foo [max] bar <- IS CHECKBOX
```shell
foo [max] bar <- IS CHECKBOX
```
foo[max] bar <- IS CHECKBOX
foo[max]bar <- NOT CHECKBOX
foo [max]bar <- NOT CHECKBOX```

[min] bar <- NOT CHECKBOX
[max] tree <- IS CHECKBOX
foo [axe] tree <- NOT CHECKBOX
foo [xxx] tree <- IS CHECKBOX
foo [paranoiax] tree <- IS CHECKBOX
foo [xav] tree <- NOT CHECKBOX
foo [xxb] tree <- NOT CHECKBOX

@Romsick Romsick changed the title Writing "[max] something" counts as a Checkbox Writing a word ending with "x" between brackets counts as a Checkbox Dec 11, 2017
@kazup01 kazup01 added the help wanted 🆘 Pull request/issue requires extra help from the community. Check these out if you're new! label Dec 12, 2017
@nebloc
Copy link
Contributor

nebloc commented Dec 12, 2017

Presuming that a checkbox can only be written in two ways
- [ ] unmarked
and
- [x] marked
then
https://github.com/BoostIO/Boostnote/blob/4c3e62efadffce2a1d7cf8bf496a522bd4379f5f/browser/lib/getTodoStatus.js#L8
Should be
if (trimmedLine.match(/^[\+\-\*] \[(\s|x)\] ./)) {
adding the brackets around the \s|x to make sure the or statement is only for the character in the box

@kazup01 kazup01 added next release (v0.8.19) and removed help wanted 🆘 Pull request/issue requires extra help from the community. Check these out if you're new! labels Dec 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants