Skip to content

Commit

Permalink
Support then-jade in jade.render function
Browse files Browse the repository at this point in the history
  • Loading branch information
ForbesLindesay committed Jan 6, 2013
1 parent ee2234e commit 216d499
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 216d499

Please sign in to comment.