diff --git a/js/macros/image.js b/js/macros/image.js index ffba2f742..ec4522071 100644 --- a/js/macros/image.js +++ b/js/macros/image.js @@ -7,7 +7,8 @@ title: js/macros/image.js /*jslint node: true */ "use strict"; -var utils = require("../Utils.js"); +var HTML = require("../HTML.js").HTML, + utils = require("../Utils.js"); exports.macro = { name: "image", @@ -21,23 +22,21 @@ exports.macro = { if(type === "text/html") { if(store.tiddlerExists(params.src)) { if(params.text) { - return utils.stitchElement("div",{ - alt: params.text, - title: params.text - },{ - content: store.renderTiddler(type,params.src) - }); + return HTML(HTML.elem("div",{ + alt: params.text, + title: params.text + },[ + HTML.raw(store.renderTiddler(type,params.src)) + ])); } else { return store.renderTiddler(type,params.src); } } else { - return utils.stitchElement("img",{ + return HTML(HTML.elem("img",{ href: params.src, alt: params.text, title: params.text - },{ - selfClosing: true - }); + })); } } else if (type === "text/plain") { return params.text ? params.text : ""; diff --git a/js/macros/info.js b/js/macros/info.js index d26a1aa53..b5157d8be 100644 --- a/js/macros/info.js +++ b/js/macros/info.js @@ -7,7 +7,8 @@ title: js/macros/info.js /*jslint node: true */ "use strict"; -var utils = require("../Utils.js"); +var HTML = require("../HTML.js").HTML, + utils = require("../Utils.js"); exports.macro = { name: "info", @@ -30,22 +31,22 @@ exports.macro = { var parseTree = store.parseTiddler(tiddler.title); switch(info) { case "parsetree": - return utils.stitchSlider(type, + return HTML(HTML.slider(type, "Parse tree", "The parse tree for this tiddler", - parseTree.toString(type)); + parseTree.toString(type)),type); //break; case "compiled": - return utils.stitchSlider(type, + return HTML(HTML.slider(type, "Render functions", "The render functions for this tiddler", - parseTree.compile(type).toString(type)); + parseTree.compile(type).toString(type)),type); //break; case "dependencies": - return utils.stitchSlider(type, + return HTML(HTML.slider(type, "Dependencies", "The dependencies for this tiddler", - (parseTree.dependencies === null) ? "*" : encoder(parseTree.dependencies.join(", "))); + (parseTree.dependencies === null) ? "*" : encoder(parseTree.dependencies.join(", "))),type); //break; } } diff --git a/js/macros/link.js b/js/macros/link.js index 217ce07f6..08b607526 100644 --- a/js/macros/link.js +++ b/js/macros/link.js @@ -7,7 +7,8 @@ title: js/macros/link.js /*jslint node: true, browser: true */ "use strict"; -var utils = require("../Utils.js"); +var HTML = require("../HTML.js").HTML, + utils = require("../Utils.js"); exports.macro = { name: "link", @@ -27,16 +28,14 @@ exports.macro = { } }, 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; - } + return HTML(HTML.elem( + "a",{ + href: params.target, + "class": store.adjustClassesForLink([],params.target) + },[ + HTML.raw(content) + ] + ),type); } };