1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-12-01 06:18:06 +00:00

Added ability to suppress the wrapper HTML nodes required by the refresh circuitry

This commit is contained in:
Jeremy Ruston
2012-01-30 18:26:05 +00:00
parent 6066b5cf89
commit b0fc3d4668
2 changed files with 5 additions and 3 deletions

View File

@@ -20,9 +20,11 @@ var Tiddler = require("./Tiddler.js").Tiddler,
Available options are:
shadowStore: An existing WikiStore to use for shadow tiddler storage. Pass null to prevent a default shadow store from being created
disableHtmlWrapperNodes: If true will suppress the generation of the wrapper nodes used by the refresh and diagnostic machinery
*/
var WikiStore = function WikiStore(options) {
options = options || {};
this.disableHtmlWrapperNodes = !!options.disableHtmlWrapperNodes;
this.tiddlers = {}; // Hashmap of tiddlers by title
this.parsers = {}; // Hashmap of parsers by accepted MIME type
this.macros = {}; // Hashmap of macros by macro name
@@ -342,7 +344,7 @@ store.renderTiddler("text/html",templateTitle,tiddlerTitle)
*/
WikiStore.prototype.renderTiddler = function(targetType,title,asTitle,options) {
options = options || {};
var stitcher = ((targetType === "text/html") && !options.noWrap) ? utils.stitchElement : function(a,b,c) {return c.content;},
var stitcher = ((targetType === "text/html") && !options.noWrap && !this.disableHtmlWrapperNodes) ? utils.stitchElement : function(a,b,c) {return c.content;},
tiddler = this.getTiddler(title),
renderer = this.compileTiddler(title,targetType),
renditions = this.getCacheForTiddler(title,"renditions",function() {