Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.compile = function (content, options, fn) {
// Copy data to root
options = Object.assign({}, options, DEFAULT_OPTIONS, options.data);
jade.render(content, options, (err, content) => {
if (err) {
err.filepath = options.filepath;
return fn(err);
}
fn(null, content);
});
};
parseEjs: function(content, options, callback) {
var ejs = require('ejs');
content = ejs.render(content.toString(), options);
callback(content);
},
module.exports = through('jade', function(file, config) {
if(config.strict && path.extname(file.path) !== '.jade') return;
var result = jade.render(String(file.contents), extend(config, config.locals));
file.contents = new Buffer(result);
if(config.rename) {
file.path = gutil.replaceExtension(file.path, '.html');
}
}, defaults);
function html (file, opts) {
file.filename = basename(file.filename) + '.html';
file.contents = jade.render(file.contents, opts);
return file;
}