mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-24 02:27:19 +00:00
Use the new widget mechanism for stylesheet parsing and rendering
This commit is contained in:
parent
79e7dc4f18
commit
ce1fb300f8
@ -34,12 +34,7 @@ StylesheetManager.prototype.addStylesheet = function(title) {
|
|||||||
// Record the stylesheet in the hashmap
|
// Record the stylesheet in the hashmap
|
||||||
this.stylesheets[title] = true;
|
this.stylesheets[title] = true;
|
||||||
// Parse the tiddler and render as plain text
|
// Parse the tiddler and render as plain text
|
||||||
var parser = this.wiki.parseTiddler(title),
|
var text = this.wiki.new_renderTiddler("text/plain",title);
|
||||||
renderTree = new $tw.WikiRenderTree(parser,{wiki: this.wiki, context: {tiddlerTitle: title}, document: $tw.document});
|
|
||||||
renderTree.execute();
|
|
||||||
var container = $tw.document.createElement("div");
|
|
||||||
renderTree.renderInDom(container);
|
|
||||||
var text = container.textContent;
|
|
||||||
// Create a style element and put it in the document
|
// Create a style element and put it in the document
|
||||||
var styleNode = document.createElement("style");
|
var styleNode = document.createElement("style");
|
||||||
styleNode.setAttribute("type","text/css");
|
styleNode.setAttribute("type","text/css");
|
||||||
|
Loading…
Reference in New Issue
Block a user