Permalink
Browse files

fix renderTemplate and getTemplateFunction helpers

  • Loading branch information...
1 parent e9be0aa commit 461b08deb10632ac90597b534cffdaffc84506a2 @dmachi committed Sep 28, 2010
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/templify.js
View
@@ -20,11 +20,12 @@ exports.Resolver = require("./resolver").Resolver;
exports.renderTemplate = function(templateString, context, options){
print("renderTemplate");
- var template = new Template(templateString, options);
+
+ var template = new Template((typeof templateString=='array')?templateString:[templateString], options);
return template(context);
};
exports.getTemplateFunction = function(templateString, options){
- var template = new Template(templateString,options);
- return template.parse(templateString);
+ var template = new Template((typeof templateString=='array')?templateString:[templateString], options);
+ return template.toString();
};

0 comments on commit 461b08d

Please sign in to comment.