源代码中的 Node.js JADE 换行符? [英] Node.js JADE linebreaks in source?
本文介绍了源代码中的 Node.js JADE 换行符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道,如果我解析我的 jade 模板,为什么在我的源代码中看不到任何换行符.它看起来像这样:
I wonder, why i don't see any linebreaks in my sourcecode if i parse my jade template. It looks like this:
!!! 5
html
head
title= title
link(rel='stylesheet', href='/stylesheets/css.css')
link(rel='stylesheet', href='/stylesheets/blitzer/jquery-ui-1.8.10.custom.css')
link(rel='stylesheet', href='/stylesheets/table_jui.css')
script(type="text/javascript", src="/javascripts/jquery.min.js")
script(type="text/javascript", src="/javascripts/jquery-ui.min.js")
script(type="text/javascript", src="/javascripts/jquery.jwNotify.js")
script(type="text/javascript", src="/javascripts/jquery.dataTables.min.js")
script(type="text/javascript", src="/javascripts/js.js")
body!= body
现在我的源代码如下所示:
Now my sourcecode looks like this:
<!DOCTYPE html><html><head><title>Express v2</title><link rel="stylesheet" href="/stylesheets/css.css"><link rel="stylesheet" href="/stylesheets/blitzer/jquery-ui-1.8.10.custom.css"><link rel="stylesheet" href="/stylesheets/table_jui.css"><script type="text/javascript" src="/javascripts/jquery.min.js"></script><script type="text/javascript" src="/javascripts/jquery-ui.min.js"></script><script type="text/javascript" src="/javascripts/jquery.jwNotify.js"></script><script type="text/javascript" src="/javascripts/jquery.dataTables.min.js"></script><script type="text/javascript" src="/javascripts/js.js"></script></head><body></body></html>
是否可以在源代码中看到换行符以进行调试?任何人都有一个ideo,我该如何管理?谢谢你的信息!
Would be fine to see line breaks in sourcecode to debug or not? Anyone has an ideo, how i can manage this? Thx for info!
推荐答案
有时,您希望看到漂亮的 html 输出.要取消丑化您的 Jade 输出,请将 pretty
选项传递给 app.js 中的编译器:
Sometimes, you want to see pretty html output. To un-uglify your Jade output, pass the pretty
option to the compiler in your app.js:
app.set('view options', { pretty: true });
这篇关于源代码中的 Node.js JADE 换行符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文