【问题标题】:Insert a newline manually in Jade在 Jade 中手动插入换行符
【发布时间】:2012-10-12 07:51:26
【问题描述】:

我有一个看起来像这样的 mixin

mixin preprocessor_instructions()
  some text goes here

这实际上不仅仅是文本,而是我的预处理器的更多技术指令。我不希望它在任何标签内。问题是当我像这样在 Jade 模板中使用这个 mixin 时

+preprocessor_instructions

它不会在这段代码之前的输出 html 中插入换行符,尽管我希望在那里看到它让它看起来更漂亮。如何使用 Jade 手动插入换行符?

【问题讨论】:

    标签: html node.js pug


    【解决方案1】:

    您可以使用内联 HTML:

    mixin preprocessor_instructions()
      | //- <- note the space after the pipe
      some text goes here
    
    +preprocessor_instructions
    

    【讨论】:

      猜你喜欢
      • 2013-09-21
      • 2011-03-05
      • 2011-01-22
      • 2012-11-24
      • 1970-01-01
      • 1970-01-01
      • 2011-11-17
      • 1970-01-01
      • 2012-03-05
      相关资源
      最近更新 更多