From b90c9ef9a08ad63e8a00f90a1e89a79688cb613b Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Sat, 17 Jun 2023 10:32:44 +0100 Subject: [PATCH] Transclude widget should only create double underscore variables for macros and ordinary variables Fixes #7544 --- core/modules/widgets/transclude.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/modules/widgets/transclude.js b/core/modules/widgets/transclude.js index 1117598de..9902f7632 100755 --- a/core/modules/widgets/transclude.js +++ b/core/modules/widgets/transclude.js @@ -178,7 +178,6 @@ TranscludeWidget.prototype.getTransclusionTarget = function() { srcVariable = variableInfo && variableInfo.srcVariable; if(variableInfo.text) { if(srcVariable.isFunctionDefinition) { - // Function to return parameters by name or position var result = (variableInfo.resultList ? variableInfo.resultList[0] : variableInfo.text) || ""; parser = { tree: [{ @@ -235,7 +234,7 @@ TranscludeWidget.prototype.getTransclusionTarget = function() { } $tw.utils.addAttributeToParseTreeNode(parser.tree[0],name,param["default"]) }); - } else { + } else if(srcVariable.isMacroDefinition || !srcVariable.isFunctionDefinition) { // For macros and ordinary variables, wrap the parse tree in a vars widget assigning the parameters to variables named "__paramname__" parser = { tree: [