1

我希望在 pre 元素中包含一个注释块,但我会收到以下错误:

Line 573: Unexpected token ===

我的玉pre块是:

pre(class = "brush:javascript")
            /*------------------------------------------------------------------------------------------------------------------------
            @Author: Author Name
            @www: www.author-site.ca
            @github: author-github-username

            @package: project-name
            =============================================================================
            Filename: filename.js
            =============================================================================
            This file is responsible for...
            --------------------------------------------------------------------------------------------------------------------- */

我在Jade Documentation上读到pre元素默认被转义;但是,鉴于上述错误,情况似乎并非如此。

如何在不出现语法错误的情况下转义上述代码块?

4

2 回答 2

1

只需在标记后添加一个点(在Jade 文档中称为“标记中的块”)。

pre.(class = "brush:javascript")
  /*------------------------------------------------------------------------------------------------------------------------
  @Author: Author Name
  @www: www.author-site.ca
  @github: author-github-username
于 2014-07-24T15:03:03.993 回答
0

我解决了这个问题...

您必须将转义的内容作为pre(duh?) 的一部分包含在内,并且不要将其嵌套在其下:

pre(class = "brush:javascript")
  | /*------------------------------------------------------------------------------------------------------------------------
  | @Author: Author Name
  | @www: www.author-site.ca
  | @github: author-github-username
  |
  | @package: project-name
  | =============================================================================
  | Filename: filename.js
  | =============================================================================
  | This file is responsible for...
  |
  | --------------------------------------------------------------------------------------------------------------------- */

所以在玉中,|表示这...

于 2013-07-21T22:03:15.780 回答