textlint-rule / textlint-rule-no-todo

textlint rule that check TODO text.
MIT License
11 stars 7 forks source link

Incorrectly reporting "todo" item #5

Open amimas opened 5 years ago

amimas commented 5 years ago

I have a list in my markdown and one of the list item is like this:

- A `rel` or `path` contains non-supported characters.

    This includes spaces, control characters, and unsafe URI characters, For example: ```$ & + , / : ; = ? @ < > # % { } | \ ^~ [ ] ` ' "``` returns an error.

The above list item gets reported as containing a TODO. It seems the rule is catching this because there's a [ ] in the description paragraph of that list item.

The rule should be looking for [ ] at the beginning of a list item in order for it to be really a TODO item.

azu commented 5 years ago

https://github.com/textlint-rule/textlint-rule-no-todo/blob/96ea8eee67c6f5d8534bc71db17d2323888c1048/src/no-todo.js#L44

This is caused by the above loose matching.