todotxtio
todotxtio copied to clipboard
Detection of projects and context fails if either is first word in task
Let's assume i have the following task:
2018-05-19 +read webpage http://todotxt.org/ +background
todotxtio recognizes the project background very well, but it does not recognize read as a project. This is due to the regular expression, which needs a space in front of a project/context.
It seems that during parsing of tasks this is not given, if the project/context is directly at the beginning of a task or if the project/context directly followings a date.
In your example the first project is preceeded by a space, so it should work?
That is an example, where it fails. My guess is that the date is recognized by a regex and that the rest string is evaluated or spaces are stripped of. Then a space would be missing. Just try a similar line in your todo.txt
#16 Should fix this issue.
If anyone doesn't want to wait on this/use a fork, I think the topydo/lib/TodoParser has a good parser for todo.txt lines.
Doesn't have the convenience functions to read/write to files, but its a good starting point to wrap if you just want to write a quick script to parse a todotxt file.
It handles both the done.txt and todo.txt files, has worked well for my use case