mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-08-20 14:45:59 +00:00
![Jeremy Ruston](/assets/img/avatar_default.png)
We now use a fake DOM implementation on the server to let us share more rendering code between the text output vs. DOM output paths.
32 lines
654 B
JavaScript
32 lines
654 B
JavaScript
/*\
|
|
title: $:/core/modules/rendertree/renderers/entity.js
|
|
type: application/javascript
|
|
module-type: wikirenderer
|
|
|
|
Entity renderer
|
|
|
|
\*/
|
|
(function(){
|
|
|
|
/*jslint node: true, browser: true */
|
|
/*global $tw: false */
|
|
"use strict";
|
|
|
|
/*
|
|
Entity renderer
|
|
*/
|
|
var EntityRenderer = function(renderTree,parentRenderer,parseTreeNode) {
|
|
// Store state information
|
|
this.renderTree = renderTree;
|
|
this.parentRenderer = parentRenderer;
|
|
this.parseTreeNode = parseTreeNode;
|
|
};
|
|
|
|
EntityRenderer.prototype.renderInDom = function() {
|
|
return this.renderTree.document.createTextNode($tw.utils.entityDecode(this.parseTreeNode.entity));
|
|
};
|
|
|
|
exports.entity = EntityRenderer
|
|
|
|
})();
|