1
0
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:
Jeremy Ruston 2012-01-23 16:41:49 +00:00
parent fd9d4973e3
commit 82a37d3ab4

View File

@ -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;
}
}
}
};