I’m actually fine with these.
I have some files in the same directory that use very similar queries, some of them return data, and some don’t.
When there’s nothing to return, having this as a placeholder makes it clear to me that it’s intentional.
If it just returned nothing without any indication, that wouldn’t be ideal either.
I haven’t looked at the code, but this is probably how an empty Markdown table is returned by default.
That appears to be how an empty table is printed. ${{}} prints the same thing. I’m guessing it’s the start of the table markdown, but it’s not recognized as markdown because too much is missing.
I’m would prefer either no change or printing nothing. That way we can handle empty queries with a specific message more easily. You can have queries with no results return nothing instead of the empty table with ${query[[from index.tag "foo"]] or ""}, or you can put your own message ${query[[from index.tag "foo" ]] or "No foo found, everything is bar"}.
I recently implemented a similar feature for displaying the query with template function:
I agree that query... or "nothing" is a nice Lua-ism, and it works right now. However, I expect a bunch of other places to fail gracefully with empty table and freak out with nil, so we should test it well before merging.
I think this should clear up the confusion with empty results and document a way to make them nicer. Thanks @lochel for pointing this out, it’s been in SilverBullet for ages but I never really put some thought into it. In the end it was just a two-line change