包含<pre>

时间:2016-02-03 02:35:25

标签: html pug

I have some static html documents, and I want to convert them into Jade. I tried html2jade in npm, everything is OK except this: the <pre> elements in html convert empty, can someone help me?

The html code looks like this:

<pre><code>&lt;p&gt;Hello&lt;/p&gt;&lt;span&gt;Hello Again&lt;/span&gt;</code></pre>

The result is:

pre.

1 个答案:

答案 0 :(得分:0)

You can write that a couple different ways in Jade. Here are two different methods. The first takes advantage of Jade's automatic escaping while the second uses HTML entities instead.

Automatic escaping:

pre
    code= '<p>Hello</p><span>Hello Again</span>'

HTML entities:

pre
    code &lt;p&gt;Hello&lt;/p&gt;&lt;span&gt;Hello Again&lt;/span&gt;