我希望在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
元素默认转义;但是,鉴于上述错误,情况似乎并非如此。
如何在不收到语法错误的情况下转义上述代码块?
答案 0 :(得分:1)
只需在标记后添加一个点(在the Jade documentation as "Block in a Tag"中引用)。
pre.(class = "brush:javascript")
/*------------------------------------------------------------------------------------------------------------------------
@Author: Author Name
@www: www.author-site.ca
@github: author-github-username
答案 1 :(得分: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...
|
| --------------------------------------------------------------------------------------------------------------------- */
所以在玉器中,|
表示这个......