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

Bug report - Dataview fails to detect tasks starting with 1. #2464

Open
PhysicsInformedNoodle opened this issue Oct 28, 2024 · 1 comment
Open
Labels
bug Something isn't working.

Comments

@PhysicsInformedNoodle
Copy link

What happened?

I task queried for:
- [ ] 1. test keloggs
I got no matches.

And then I queried for:
- [ ] 1 test keloggs
I got a match for this, which is the expected behavior.

I provide the query below.

DQL

No response

JS

dv.pages(`"Tasks"`).file.tasks
	        .filter(task => task.text.includes("keloggs"));

Dataview Version

v0.5.67

Obsidian Version

v1.7.4

OS

Windows

@PhysicsInformedNoodle PhysicsInformedNoodle added the bug Something isn't working. label Oct 28, 2024
@holroy
Copy link
Contributor

holroy commented Dec 28, 2024

I tested this using this text in a file:

- [ ] 1. test keloggs
- [ ] 1 test keloggs

```dataview
TASK
WHERE file = this.file
  AND contains(text, "kel")
```

And in version 1.6.3 and 1.7.7 when you switch to reading mode you'll get this output:

image

So the explanation is that the renderer doesn't see the first task as a simple task, but rather more like a task consisting of a numbered list. As such, the WHERE clause doesn't match for the task itself, since the text is actually contained in the children elements of the task...

I'm not entirely sure, but I wonder if this anomaly has been fixed in 1.8.0 of Obsidian, which I've not installed anywhere just now. So I'll keep a watch out for this, but I do believe this is due to strange rendering outside the scope of Dataview's code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

2 participants