Skip to content

Commit

Permalink
Merge pull request #82 from ForbesLindesay/patch-1
Browse files Browse the repository at this point in the history
Support `then-jade` in `jade.render` function
  • Loading branch information
tj committed Jan 7, 2013
2 parents ee2234e + 216d499 commit 5cfeff9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/consolidate.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,14 @@ exports.jade = function(path, options, fn){
*/

exports.jade.render = function(str, options, fn){
var engine = requires.jade || (requires.jade = require('jade'));
var engine = requires.jade;
if (!engine) {
try {
engine = requires.jade = require('jade');
} catch (err) {
engine = requires.jade = require('then-jade');
}
}
engine.render(str, options, fn);
};

Expand Down

0 comments on commit 5cfeff9

Please sign in to comment.