1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-01-25 16:36:52 +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"]; parser = this.parsers["text/x-tiddlywiki"];
} }
if(parser) { if(parser) {
return parser.parse(text); return parser.parse(type,text);
} else { } else {
return null; return null;
} }
@ -367,7 +367,13 @@ Executes a macro and returns the result
WikiStore.prototype.renderMacro = function(macroName,targetType,tiddler,params,content) { WikiStore.prototype.renderMacro = function(macroName,targetType,tiddler,params,content) {
var macro = this.macros[macroName]; var macro = this.macros[macroName];
if(macro) { 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 { } else {
return null; return null;
} }