This works nearly perfect, however there is a flaw. The following items are displayed
[ ] Test 1 #bau
[ ] 1 Test #bau
[ ] Test 1. #bau
but not this line
[ ] 1. Test #bau
It seems like every line beginning with a number followed by a dot, so appearing a bit like a numbered list, seems to be ignored even though it’s not supposed to be. I’m not sure if my code is flawed here or if it’s a bug in dataviewjs.
And in a sandbox vault (in 1.1.16 with installer 1.1.16), it does display as the following:
One can clearly see that “TestD” indeed displays as a task with a numbered list. So this is somewhat related to some markdown syntax issue. As such I don’t think dataview is to blame for not recognising this as a task, which it doesn’t. It’s only registered as another list item, see image below:
I’m not sure whether this is just a feature or to be considered a bug of some sort. But I can confirm that this behaviour exists, and as long as dataview doesn’t recognise it as task, it’ll not be listed in any TASK related queries, like my TASK ... above, or through the use of file.tasks in your query.
Are you able to avoid that particular syntax, or is it something you’re likely to keep writing in your use cases? (I see that doing 1 . avoid this behaviour, and also other variants like \1. or <span />1., but neither looks particular good in source mode (or reading view for some of them))
Thanks for your review and comments! I honestly never use the “reading” mode in obsidian, since the “editing” mode works perfectly fine for me also for reading, therefore I never observed that it is actually treated as a numbered list.
I can try to avoid the syntax, but I’m a bit afraid that I might forget about this once and therefore miss some important task. That’s what nearly happened here when finding out about the problem. So it would be great to know that there is no risk of ignored tasks.
Yes, I might raise an issue there, I was just hesitant as long as I wasn’t sure whether the reason might be a flaw in my code. Let’s see if that might be changed or there might be another solution to that. Could I use your screenshots there?