/*\ title: $:/core/modules/rendertree/wikirendertree.js type: application/javascript module-type: global Wiki text render tree \*/ (function(){ /*jslint node: true, browser: true */ /*global $tw: false */ "use strict"; /* Create a render tree object for a parse tree */ var WikiRenderTree = function(parser,options) { this.parser = parser; this.wiki = options.wiki; }; /* Generate the full render tree for this parse tree renderContext: see below An renderContext consists of these fields: tiddlerTitle: title of the tiddler providing the context parentContext: reference back to previous context in the stack */ WikiRenderTree.prototype.execute = function(renderContext) { this.rendererTree = this.createRenderers(renderContext,this.parser.tree); }; /* Create an array of renderers for an array of parse tree nodes */ WikiRenderTree.prototype.createRenderers = function(renderContext,parseTreeNodes) { var rendererNodes = []; if(parseTreeNodes) { for(var t=0; t