1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-09 19:39:57 +00:00
TiddlyWiki5/js/macros/echo.js

28 lines
425 B
JavaScript
Raw Normal View History

/*\
title: js/macros/echo.js
\*/
(function(){
/*jslint node: true */
"use strict";
var utils = require("../Utils.js");
exports.macro = {
name: "echo",
types: ["text/html","text/plain"],
params: {
text: {byPos: 0, type: "text", optional: false}
},
2012-01-30 20:04:47 +00:00
render: function(type,tiddler,store,params) {
if(type === "text/html") {
return utils.htmlEncode(params.text);
} else {
return params.text;
}
}
};
})();