mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-07-08 13:02:51 +00:00
A slightly better fix for the render context inheritance issue with the htmlwikified viewer for the view widget
This commit is contained in:
parent
98986ba9cc
commit
07d4c9a639
@ -19,6 +19,7 @@ Create a render tree object for a parse tree
|
|||||||
Options include:
|
Options include:
|
||||||
wiki: mandatory reference to wiki associated with this render tree
|
wiki: mandatory reference to wiki associated with this render tree
|
||||||
context: optional hashmap of context variables (see below)
|
context: optional hashmap of context variables (see below)
|
||||||
|
parentRenderer: optional reference to a parent renderer node for the context chain
|
||||||
Context variables include:
|
Context variables include:
|
||||||
tiddlerTitle: title of the tiddler providing the context
|
tiddlerTitle: title of the tiddler providing the context
|
||||||
templateTitle: title of the tiddler providing the current template
|
templateTitle: title of the tiddler providing the current template
|
||||||
@ -28,6 +29,7 @@ var WikiRenderTree = function(parser,options) {
|
|||||||
this.parser = parser;
|
this.parser = parser;
|
||||||
this.wiki = options.wiki;
|
this.wiki = options.wiki;
|
||||||
this.context = options.context || {};
|
this.context = options.context || {};
|
||||||
|
this.parentRenderer = options.parentRenderer;
|
||||||
// Hashmap of the renderer classes
|
// Hashmap of the renderer classes
|
||||||
if(!this.rendererClasses) {
|
if(!this.rendererClasses) {
|
||||||
WikiRenderTree.prototype.rendererClasses = $tw.modules.applyMethods("wikirenderer");
|
WikiRenderTree.prototype.rendererClasses = $tw.modules.applyMethods("wikirenderer");
|
||||||
|
@ -23,7 +23,7 @@ HtmlWikifiedViewer.prototype.render = function() {
|
|||||||
// Parse the field text
|
// Parse the field text
|
||||||
var wiki = this.viewWidget.renderer.renderTree.wiki,
|
var wiki = this.viewWidget.renderer.renderTree.wiki,
|
||||||
parser = wiki.parseText("text/vnd.tiddlywiki",this.value),
|
parser = wiki.parseText("text/vnd.tiddlywiki",this.value),
|
||||||
renderTree = new $tw.WikiRenderTree(parser,{wiki: wiki, context: this.viewWidget.renderer.renderTree.context});
|
renderTree = new $tw.WikiRenderTree(parser,{wiki: wiki, parentRenderer: this.viewWidget.renderer});
|
||||||
renderTree.execute();
|
renderTree.execute();
|
||||||
var text = renderTree.render("text/html");
|
var text = renderTree.render("text/html");
|
||||||
// Set the element details
|
// Set the element details
|
||||||
|
Loading…
x
Reference in New Issue
Block a user