1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-07-01 17:53:15 +00:00

When transcluding functions, pass an empty item list to the filter, and just return the first item

This commit is contained in:
jeremy@jermolene.com 2022-09-09 10:22:06 +01:00
parent 7b465888c8
commit e3697e29bb

View File

@ -223,7 +223,7 @@ TranscludeWidget.prototype.getTransclusionTarget = function() {
variables[name] = param["default"];
}
});
var result = this.wiki.filterTiddlers(srcVariable.value,this.makeFakeWidgetWithVariables(variables)).join("");
var result = this.wiki.filterTiddlers(srcVariable.value,this.makeFakeWidgetWithVariables(variables),this.wiki.makeTiddlerIterator([]))[0] || "";
parser = this.wiki.parseText(this.transcludeType,result || "",{parseAsInline: parseAsInline, configTrimWhiteSpace: srcVariable.configTrimWhiteSpace});
} else {
// For macros and ordinary variables, wrap the parse tree in a vars widget assigning the parameters to variables named "__paramname__"