mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-08-25 02:56:43 +00:00
![Jeremy Ruston](/assets/img/avatar_default.png)
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
38 lines
737 B
JavaScript
38 lines
737 B
JavaScript
/*\
|
|
title: $:/core/modules/rendertree/renderers/raw.js
|
|
type: application/javascript
|
|
module-type: wikirenderer
|
|
|
|
Raw HTML renderer
|
|
|
|
\*/
|
|
(function(){
|
|
|
|
/*jslint node: true, browser: true */
|
|
/*global $tw: false */
|
|
"use strict";
|
|
|
|
/*
|
|
Raw HTML renderer
|
|
*/
|
|
var RawRenderer = function(renderTree,parentRenderer,parseTreeNode) {
|
|
// Store state information
|
|
this.renderTree = renderTree;
|
|
this.parentRenderer = parentRenderer;
|
|
this.parseTreeNode = parseTreeNode;
|
|
};
|
|
|
|
RawRenderer.prototype.render = function(type) {
|
|
return this.parseTreeNode.html;
|
|
};
|
|
|
|
RawRenderer.prototype.renderInDom = function() {
|
|
var domNode = document.createElement("div");
|
|
domNode.innerHTML = this.parseTreeNode.html;
|
|
return domNode;
|
|
};
|
|
|
|
exports.raw = RawRenderer
|
|
|
|
})();
|