diff --git a/js/macros/story.js b/js/macros/story.js index ee7a1cff2..2871f70f3 100644 --- a/js/macros/story.js +++ b/js/macros/story.js @@ -17,21 +17,18 @@ exports.macro = { template: {byName: true, type: "text", optional: true} }, code: function(type,tiddler,store,params) { - var templateType = "text/x-tiddlywiki", - templateText = "<>", - template = params.template ? store.getTiddler(params.template) : null, - tiddlers = store.getTiddlerText(params.story).split("\n"), + var tiddlers = store.getTiddlerText(params.story).split("\n"), t, output = []; - if(template) { - templateType = template.fields.type; - templateText = template.fields.text; - } for(t=0; t"); - output.push(store.renderText(templateType,templateText,"text/html",title)); + if(params.template) { + output.push(store.renderTiddler(type,params.template,title)); + } else { + output.push(store.renderTiddler(type,title)); + } output.push(""); } }