2012-12-13 21:34:31 +00:00
|
|
|
/*\
|
|
|
|
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
|
|
|
|
*/
|
2013-05-15 16:32:17 +00:00
|
|
|
var EntityRenderer = function(renderTree,parentRenderer,parseTreeNode) {
|
2012-12-13 21:34:31 +00:00
|
|
|
// Store state information
|
|
|
|
this.renderTree = renderTree;
|
2013-05-15 16:32:17 +00:00
|
|
|
this.parentRenderer = parentRenderer;
|
2012-12-13 21:34:31 +00:00
|
|
|
this.parseTreeNode = parseTreeNode;
|
|
|
|
};
|
|
|
|
|
|
|
|
EntityRenderer.prototype.renderInDom = function() {
|
2013-05-17 09:12:25 +00:00
|
|
|
return this.renderTree.document.createTextNode($tw.utils.entityDecode(this.parseTreeNode.entity));
|
2012-12-13 21:34:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
exports.entity = EntityRenderer
|
|
|
|
|
|
|
|
})();
|