blacksmithgu / obsidian-dataview

A data index and query language over Markdown files, for https://obsidian.md/.
https://blacksmithgu.github.io/obsidian-dataview/
MIT License
6.94k stars 411 forks source link

Tasks: Dataview shows empty tasks #2255

Open RebeccaCotton opened 7 months ago

RebeccaCotton commented 7 months ago

What happened?

I create empty task lists (e.g. for templates). In data view these get picked up as tasks however and shown in the overview. s. first bullet in this dataview list (see image) Screenshot_20240301_155854

Expected behaviour: Empty tasks are not shown in the Dataview result. So if there is only a linebreak or space after the - [ ]` then the item should not appear in the dataview list.

DQL

task from #todo/Business  
where !completed

JS

No response

Dataview Version

0.5.64

Obsidian Version

1.5.8

OS

Linux

holroy commented 7 months ago

When you define a task, even if empty, it's still defined as a task, so why do you consider it a bug?

If you don't want to remove these explicitly from your notes, you could try to eliminate them using something like the following:

```dataview
TASK 
WHERE text


Which should handle whether it was actually nothing, or just spaces.
GottZ commented 6 months ago

every change breaks someones workflow

what you refer to as a bug, is actually a reasonable feature. if this is getting solved, someone else will pick up on it and suggerst a reversal. this is not a bug. 100% agreeing on @holroy as it can be achieved by just creating a more complex query.

this is working exactly as you want it to:

```dataview
task
where !completed and text

so.. I'd suggest closing this issue.