mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-24 17:10:29 +00:00
Fixed info macro when invoked in a missing tiddler
This commit is contained in:
parent
fd9d4973e3
commit
82a37d3ab4
@ -17,19 +17,21 @@ exports.macro = {
|
||||
},
|
||||
handler: function(type,tiddler,store,params) {
|
||||
var encoder = type === "text/html" ? utils.htmlEncode : function(x) {return x;},
|
||||
info = params.info ? params.info : "parsetree",
|
||||
parseTree = store.parseTiddler(tiddler.title);
|
||||
switch(info) {
|
||||
case "parsetree":
|
||||
return "Parse tree: " + parseTree.toString(type);
|
||||
//break;
|
||||
case "dependencies":
|
||||
if(parseTree.dependencies === null) {
|
||||
return encoder("Dependencies: *");
|
||||
} else {
|
||||
return encoder("Dependencies: " + parseTree.dependencies.join(", "));
|
||||
}
|
||||
break;
|
||||
info = params.info ? params.info : "parsetree";
|
||||
if(tiddler) {
|
||||
var parseTree = store.parseTiddler(tiddler.title);
|
||||
switch(info) {
|
||||
case "parsetree":
|
||||
return "Parse tree: " + parseTree.toString(type);
|
||||
//break;
|
||||
case "dependencies":
|
||||
if(parseTree.dependencies === null) {
|
||||
return encoder("Dependencies: *");
|
||||
} else {
|
||||
return encoder("Dependencies: " + parseTree.dependencies.join(", "));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user