1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-02 14:29:55 +00:00

fix: macrodef with comment (void node) not working

This commit is contained in:
lin onetwo 2024-08-07 23:53:48 +08:00
parent b8125d13b8
commit 2fa454ad84

View File

@ -52,7 +52,8 @@ ImportVariablesWidget.prototype.execute = function(tiddlerList) {
var parser = widgetPointer.wiki.parseTiddler(title,{parseAsInline:true, configTrimWhiteSpace:false}); var parser = widgetPointer.wiki.parseTiddler(title,{parseAsInline:true, configTrimWhiteSpace:false});
if(parser) { if(parser) {
var parseTreeNode = parser.tree[0]; var parseTreeNode = parser.tree[0];
while(parseTreeNode && ["setvariable","set","parameters"].indexOf(parseTreeNode.type) !== -1) { // process AST nodes generated by pragma rules.
while(parseTreeNode && ["setvariable","set","parameters","void"].indexOf(parseTreeNode.type) !== -1) {
var node = { var node = {
type: "set", type: "set",
attributes: parseTreeNode.attributes, attributes: parseTreeNode.attributes,
@ -85,7 +86,7 @@ ImportVariablesWidget.prototype.execute = function(tiddlerList) {
// this widget. If it needs to refresh, // this widget. If it needs to refresh,
// it'll do so along with the the whole // it'll do so along with the the whole
// importvariable tree. // importvariable tree.
if (widgetPointer != this) { if(widgetPointer != this) {
widgetPointer.makeChildWidgets = function(){}; widgetPointer.makeChildWidgets = function(){};
} }
widgetPointer = widgetPointer.children[0]; widgetPointer = widgetPointer.children[0];
@ -96,7 +97,7 @@ ImportVariablesWidget.prototype.execute = function(tiddlerList) {
} }
}); });
if (widgetPointer != this) { if(widgetPointer != this) {
widgetPointer.parseTreeNode.children = this.parseTreeNode.children; widgetPointer.parseTreeNode.children = this.parseTreeNode.children;
} else { } else {
widgetPointer.makeChildWidgets(); widgetPointer.makeChildWidgets();