翡翠模板HTML支架撇号和多线问题

时间:2014-11-11 09:12:36

标签: node.js pug

当我对HTML标记使用#[]语法时,我遇到了一些问题。

以下是我遇到的两个问题:

  1. 使用撇号

    p.
        #[strong John's strong text] is really strong.
    

    错误讯息:

    The end of the string was reached with no closing bracket found.]

  2. 使用多行

    p.
        #[strong This strong text is really really long. This strong
        text is really really long. This strong text is really really
        long.]
    

    错误讯息:

    The end of the string was reached with no closing bracket found.]

  3. 我尝试通过添加\来解决这两个问题,但没有运气。

3 个答案:

答案 0 :(得分:1)

您可以将'替换为

'

摆脱错误。所以回答1.你可以做到

#[strong John's strong text] and it should work as expected.

答案 1 :(得分:0)

对于任何绊脚石的人,我在Jade的GitHub上打开了一个问题,因为事实证明目前不支持1和2。

链接:https://github.com/jadejs/jade/issues/1723

答案 2 :(得分:0)

2021 年更新

根据GitHub issue #1723

  • 案例 1 是一个已在 Pug 2.0.0(2018 年发布)中修复的错误。

  • 案例 2 是故意的,因为“实际上并不清楚缩进的确切含义。”建议将其作为替代方案:

    p
      strong.
        This strong text is really really long. This strong
        text is really really long. This strong text is really really
        long.