2013-07-20 46 views
1

我期待包括pre元素內的註釋塊,但我會得到以下錯誤:玉:正確轉義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

我想通了這個問題...

你必須包括逃脫的內容作爲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... 
    | 
    | --------------------------------------------------------------------------------------------------------------------- */ 

左右的時間內玉,|表示這...

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