From ce1fb300f8e794e2c75887ad65fb1bfd1c4e976e Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Mon, 21 Oct 2013 18:38:20 +0100 Subject: [PATCH] Use the new widget mechanism for stylesheet parsing and rendering --- core/modules/utils/dom/styles.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/core/modules/utils/dom/styles.js b/core/modules/utils/dom/styles.js index 8390c0016..0f29a77db 100644 --- a/core/modules/utils/dom/styles.js +++ b/core/modules/utils/dom/styles.js @@ -34,12 +34,7 @@ StylesheetManager.prototype.addStylesheet = function(title) { // Record the stylesheet in the hashmap 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, context: {tiddlerTitle: title}, document: $tw.document}); - renderTree.execute(); - var container = $tw.document.createElement("div"); - renderTree.renderInDom(container); - var text = container.textContent; + var text = this.wiki.new_renderTiddler("text/plain",title); // Create a style element and put it in the document var styleNode = document.createElement("style"); styleNode.setAttribute("type","text/css");