From 3e1286013f4aeac80823b0ec667b4091caf2cd1f Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Thu, 3 Apr 2025 21:46:36 +0100 Subject: [PATCH] Fix bug with operators that return an iterator --- core/modules/filters/inspect.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/modules/filters/inspect.js b/core/modules/filters/inspect.js index 977a362fe..54704084f 100644 --- a/core/modules/filters/inspect.js +++ b/core/modules/filters/inspect.js @@ -54,7 +54,14 @@ exports.inspect = function(source,operator,options) { }); currentRun.push(details); var innerResults = operatorFunction.apply(null,Array.prototype.slice.call(arguments,1)); - details.output = innerResults.slice(0); + if(!$tw.utils.isArray(innerResults)) { + var resultArray = []; + innerResults(function(tiddler,title) { + resultArray.push(title); + }); + innerResults = resultArray; + } + details.output = innerResults; return innerResults; } }