Thread:Help talk:Gallery format/Gallery query with no results returns strange string that is actually not empty

Apparently there is an issue with queries in gallery format that have no results.

(All results in the following examples are live, not simulated)

A query with no results must return an empty string, right?

Example:

Result:

The result is as expected, which means that both #ask and #if work fine.

But when the query is in gallery format, then the result is not empty.

Example:

Result:

This is puzzling because there is actually no result.

If for example we try this:

123456

we get: 123456

Notice that there is nothing between 3 and 4. Even if you inspect the returned HTML with your browser you'll see nothing at all.