玉和空白

时间:2013-05-11 11:11:32

标签: node.js pug template-engine

我开始玩玉,并坚持下去:

我想输出类似的东西:

  hey! this
is pre
     text!!!

我在模板中使用制表符进行缩进,如果我在行的开头写空格,我不会同时使用制表符&空格缩进错误。

我的玉模板:

div
    pre.  hey! this
        is pre
             text!!!

还试过“|”语法。

那么,我该怎么输出呢?在此先感谢^ _ ^

2 个答案:

答案 0 :(得分:0)

我的错误很简单,或者只是错误的输入:

pre
  |  hey! this
  |      is pre
  |           text!!!

还可以使用& nbsp;作为第一个“空间”角色和“。”语法

pre.
    hey! this
         is pre
             text!

答案 1 :(得分:0)

我想出了这个:

view.jade

a.nav
  i.user
  nbsp
  | Me

的style.css

nbsp {
  width: 0.5em;
  display: inline-block;
  white-space: nowrap;
}