1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-08-07 22:33:50 +00:00

Add wrapper nodes around renderText() output

This commit is contained in:
Jeremy Ruston 2012-02-11 18:18:50 +00:00
parent fb9ea4c202
commit 8f4f8ae65f

View File

@ -295,10 +295,16 @@ WikiStore.prototype.compileTiddler = function(title,type) {
/* /*
Render a block of text of a specified type into a particular MIME type Render a block of text of a specified type into a particular MIME type
*/ */
WikiStore.prototype.renderText = function(type,text,targetType,asTitle) { WikiStore.prototype.renderText = function(type,text,targetType,asTitle,options) {
var tiddler = this.getTiddler(asTitle), options = options || {};
renderer = this.compileText(type,text,targetType); var noWrap = options.noWrap || this.disableHtmlWrapperNodes,
return renderer.render(tiddler,this); tiddler = this.getTiddler(asTitle),
renderer = this.compileText(type,text,targetType),
content = renderer.render(tiddler,this);
return noWrap ? content : HTML(HTML.elem("div",{
"data-tw-render-text": true,
"data-tw-render-as": asTitle
},[HTML.raw(content)]),targetType);
}; };
/* /*