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

34 lines
605 B
JavaScript
Raw Normal View History

/*\
title: js/macros/link.js
\*/
(function(){
/*jslint node: true */
"use strict";
var utils = require("../Utils.js");
exports.macro = {
name: "link",
wrapperTag: "span",
types: ["text/html","text/plain"],
params: {
target: {byName: "default", type: "tiddler", optional: false}
},
2012-01-30 20:04:47 +00:00
render: function(type,tiddler,store,params,content) {
if(type === "text/html") {
return utils.stitchElement("a",{
href: params.target
},{
content: content,
classes: store.adjustClassesForLink([],params.target)
});
} else if (type === "text/plain") {
return content;
}
}
};
})();