1
我正在使用Jade with nodejs和express。当我在我的玉代码上调用res.render时,它将它转换为html。但是,html没有换行符。我可以告诉玉来保存代码格式吗?如何在编译时告诉Jade保持代码格式
我正在使用Jade with nodejs和express。当我在我的玉代码上调用res.render时,它将它转换为html。但是,html没有换行符。我可以告诉玉来保存代码格式吗?如何在编译时告诉Jade保持代码格式
快递2.x的
app.set('view options', { pretty: true });
快车3.x的
app.locals.pretty = true;
向下滚动到 “视图选项” in this wiki page。
另请参阅this answer。
谢谢,这对我有用。 –