Skip to content

Commit

Permalink
fix renderTemplate and getTemplateFunction helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustin Machi committed Sep 28, 2010
1 parent e9be0aa commit 461b08d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/templify.js
Expand Up @@ -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.