mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-19 08:14:50 +00:00
e2a0955ced
Used to be called "code". And associated documentation changes
28 lines
426 B
JavaScript
28 lines
426 B
JavaScript
/*\
|
|
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}
|
|
},
|
|
handler: function(type,tiddler,store,params) {
|
|
if(type === "text/html") {
|
|
return utils.htmlEncode(params.text);
|
|
} else {
|
|
return params.text;
|
|
}
|
|
}
|
|
};
|
|
|
|
})();
|