mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-04-29 05:36:47 +00:00
Refactor rendertree to simplify context handling
Get rid of the separate renderContext stack and instead have a parent pointer on renderer nodes. This lets us walk back up the render tree to resolve context references
This commit is contained in:
@@ -35,8 +35,8 @@ StylesheetManager.prototype.addStylesheet = function(title) {
|
||||
this.stylesheets[title] = true;
|
||||
// Parse the tiddler and render as plain text
|
||||
var parser = this.wiki.parseTiddler(title),
|
||||
renderTree = new $tw.WikiRenderTree(parser,{wiki: this.wiki});
|
||||
renderTree.execute({tiddlerTitle: title});
|
||||
renderTree = new $tw.WikiRenderTree(parser,{wiki: this.wiki, context: {tiddlerTitle: title}});
|
||||
renderTree.execute();
|
||||
var text = renderTree.render("text/plain");
|
||||
// Create a style element and put it in the document
|
||||
var styleNode = document.createElement("style");
|
||||
|
||||
Reference in New Issue
Block a user