Corrected version of 'link' helper that accepts arrays of links.
[mkws-moved-to-github.git] / tools / htdocs / mkws.js
index 2ffffef..48ec152 100644 (file)
@@ -100,6 +100,20 @@ mkws.debug_function = function (string) {
 }
 var debug = mkws.debug_function; // local alias
 
+
+Handlebars.registerHelper('link', function(a) {
+    var result = "";
+    for (var i in a) {
+       if (i > 0) result += "<br/>";
+       var text = Handlebars.Utils.escapeExpression(a[i]);
+       result += '<a href="' + text + '">' + text + '</a>';
+    }
+
+    return new Handlebars.SafeString(result);
+});
+
+
+
 {
     /* default mkws config */
     var config_default = {