tasks without a preceding newline are ignored by datacore
Let's consider the following datacore query and it's equivalent in dataview:
Datacore:
const COLUMNS = [{ id: "text", value: (task) => task.$text },];
return function View() {
const tasks = dc.useQuery("@task and #test");
return <dc.Table columns={COLUMNS} rows={tasks } />;
}
Dataview
TASK
FROM #test
I found that If there is no newline before a task, datacore seems to ignores the task!
A text before the task
- [ ] test #test ⏳ 2025-10-09
On the other hand, if I add a newline, datacore works as expected
A text before the task
- [ ] test #test ⏳ 2025-10-09
I just realized that this issue also affects tasks that come after a list that had no preceding newline, e.g.;
Some text
- A list element right after the text that causes the parsing issue...
- [ ] This task will NOT SHOW UP because of the missing newline in front of the list! #task
- [ ] Also this one will NOT SHOW UP #task
As soon as there is a newline between text and a list/task, tasks show up again as expected
- [ ] This task will show up as expected, yay! #task
Bump ! Just encountered that issue too. Thanks Raphael for not having to create a new one ;).
Hello, after some investigation i think I found the rootcause of the bug. Here is a report ( AI made) . I do not have the skills do judge the proposed solutions so don't read too much into those but maybe they can serve as idea generators. The root cause analysis though is solid and based on a real simple use case with example input data from metadataCache, example output data from datacore, and the exact explanation of where it goes wrong in the code. Hoping that it'll help 😊.
After looking for the error for a while, I'm pretty sure this is the offending line:
https://github.com/blacksmithgu/datacore/blob/18b7bcc8a79f30c4793ad203e98d9975bfefaea6/src/index/import/markdown.ts#L188
When indexing list items (all tasks are list items), the code currently looks for the list block at the line before the line of the list item, as a result of the - 1 in the line above; If there's not an empty line before the list items, this lookup will find something other than a list block (i.e. a paragraph in the given examples), and thus assume the list item must be invalid and not index it. I tweaked that line locally and it seems to have fixed it for me, but I don't have many complicated tasks in my vaults to test with.
It's worth noting that - 1 was specifically added in the commit mentioned above (which checks out with this issue's original date). There's probably some reason for it to have been added, but I don't know what that would be.