From 527b750714b02bb98dcf1f68ccb5924fcddcc85c Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Tue, 24 Jan 2012 18:10:27 +0000 Subject: [PATCH] Wrap macro invocations in an information element --- js/WikiStore.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/js/WikiStore.js b/js/WikiStore.js index f283d613a..ea00ea472 100755 --- a/js/WikiStore.js +++ b/js/WikiStore.js @@ -285,7 +285,7 @@ WikiStore.prototype.parseText = function(type,text) { parser = this.parsers["text/x-tiddlywiki"]; } if(parser) { - return parser.parse(text); + return parser.parse(type,text); } else { return null; } @@ -367,7 +367,13 @@ Executes a macro and returns the result WikiStore.prototype.renderMacro = function(macroName,targetType,tiddler,params,content) { var macro = this.macros[macroName]; if(macro) { - return macro.handler(targetType,tiddler,this,params,content); + var wrapperTag = macro.wrapperTag || "div"; + return utils.stitchElement(wrapperTag,{ + "data-tw-macro": macroName, + "data-tw-render-tiddler": tiddler.title + },{ + content: macro.handler(targetType,tiddler,this,params,content) + }); } else { return null; }