This commit is contained in:
TJ Holowaychuk 2012-04-02 20:13:31 -07:00
parent dcb147608a
commit 1d485840fd

View File

@ -14,13 +14,13 @@ var app = module.exports = express();
app.engine('md', function(path, options, fn){
fs.readFile(path, 'utf8', function(err, str){
if (err) return fn(err);
try{
try {
var html = md(str);
html = html.replace(/\{([^}]+)\}/g, function(_, name){
return options[name];
return options[name] || '';
})
fn(null, html);
} catch(e){
} catch(e) {
fn(e)
}
})