1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-10-01 00:10:45 +00:00

Wrap macro invocations in an information element

This commit is contained in:
Jeremy Ruston 2012-01-24 18:10:27 +00:00
parent b92e011c66
commit 527b750714

View File

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