Gallery query with no results returns strange string that is actually not empty

From semantic-mediawiki.org

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:

{{#if: {{#ask: [[No such page]] }}
 | string is not empty
 | string is empty
}}

Result: string is not empty


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:

{{#if: {{#ask: [[No such page]] | format = gallery }}
 | string is not empty
 | string is empty
}}

Result: string is not empty


This is puzzling because there is actually no result.

If for example we try this:

123{{#ask: [[No such page]] | format = gallery }}456

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.

00:42, 27 January 2017