1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 18:17:20 +00:00

Fixes to enable <<tiddler>> macro to cope with missing tiddlers

This commit is contained in:
Jeremy Ruston 2012-02-17 12:35:21 +00:00
parent 221cc80c65
commit 167613552f
2 changed files with 7 additions and 5 deletions

View File

@ -126,6 +126,8 @@ WikiStore.prototype.getTiddlerText = function(title) {
WikiStore.prototype.deleteTiddler = function(title) {
delete this.tiddlers[title];
this.clearCache(title);
this.touchTiddler("deleted",title);
};
WikiStore.prototype.tiddlerExists = function(title) {
@ -256,11 +258,10 @@ WikiStore.prototype.parseText = function(type,text) {
WikiStore.prototype.parseTiddler = function(title) {
var me = this,
tiddler = this.getTiddler(title),
parseTree = this.getCacheForTiddler(title,"parseTree",function() {
tiddler = this.getTiddler(title);
return tiddler ? this.getCacheForTiddler(title,"parseTree",function() {
return me.parseText(tiddler.type,tiddler.text);
});
return parseTree;
}) : null;
};
/*

View File

@ -77,7 +77,8 @@ exports.macro = {
content = store.parseText(targetTiddler.type,text).tree;
} else {
// There's no parameterisation, so we can just render the target tiddler directly
content = store.parseTiddler(renderTemplate).tree;
var parseTree = store.parseTiddler(renderTemplate);
content = parseTree ? parseTree.tree : [];
}
for(t=0; t<content.length; t++) {
contentClone.push(content[t].clone());