From dec45f0fc3ce1b934ff224cc869629bf2f1ebab5 Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Thu, 26 May 2022 21:11:32 +0100 Subject: [PATCH] Fix importvariables to work with setvariables as well as set (they are aliases) --- core/modules/widgets/importvariables.js | 26 ++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/core/modules/widgets/importvariables.js b/core/modules/widgets/importvariables.js index 0c8ef5f29..1ef739253 100644 --- a/core/modules/widgets/importvariables.js +++ b/core/modules/widgets/importvariables.js @@ -49,19 +49,19 @@ ImportVariablesWidget.prototype.execute = function(tiddlerList) { var parser = widgetPointer.wiki.parseTiddler(title,{parseAsInline:true}); if(parser) { var parseTreeNode = parser.tree[0]; - while(parseTreeNode && ["set","parameters"].indexOf(parseTreeNode.type) !== -1) { - if(parseTreeNode.type === "set") { - var node = { - type: "set", - attributes: parseTreeNode.attributes, - params: parseTreeNode.params, - isMacroDefinition: parseTreeNode.isMacroDefinition, - isFunctionDefinition: parseTreeNode.isFunctionDefinition, - isProcedureDefinition: parseTreeNode.isProcedureDefinition, - isWidgetDefinition: parseTreeNode.isWidgetDefinition, - configTrimWhiteSpace: parseTreeNode.configTrimWhiteSpace - }; - if (parseTreeNode.isMacroDefinition || parseTreeNode.isProcedureDefinition) { + while(parseTreeNode && ["setvariable","set","parameters"].indexOf(parseTreeNode.type) !== -1) { + var node = { + type: "set", + attributes: parseTreeNode.attributes, + params: parseTreeNode.params, + isMacroDefinition: parseTreeNode.isMacroDefinition, + isFunctionDefinition: parseTreeNode.isFunctionDefinition, + isProcedureDefinition: parseTreeNode.isProcedureDefinition, + isWidgetDefinition: parseTreeNode.isWidgetDefinition, + configTrimWhiteSpace: parseTreeNode.configTrimWhiteSpace + }; + if(parseTreeNode.type === "set" || parseTreeNode.type === "setvariable") { + if(parseTreeNode.isMacroDefinition || parseTreeNode.isProcedureDefinition || parseTreeNode.isWidgetDefinition || parseTreeNode.isFunctionDefinition) { // Macro definitions can be folded into // current widget instead of adding // another link to the chain.