如何用Jade显示多行HTML代码块

时间:2016-05-11 06:50:55

标签: html node.js twitter-bootstrap pug

我正在使用Jade和Node js,并希望在引导程序网页中显示HTML代码块。

我试过这个

  p
    | Copy and paste the following HTML code in a web page.

  code
    | <div class="container">
    |    <iframe src="http://ea-studio.forexsb.com"
    |         style="width: 100%; min-height: 1500px" >
    |    </iframe>
    | </div>

但不是显示代码,而是执行它。结果真的好笑。我的应用程序集成了自己:)但这不是我的意图。

显示多行源代码的Jade方式是什么?

修改

转义HTML会显示代码,但只需一行:

  code
    | &lt;div class=&quot;container&quot;&gt;
    |    &lt;iframe src=&quot;http://ea-studio.forexsb.com&quot;
    |         style=&quot;width: 100%; min-height: 1500px&quot; &gt;
    |    &lt;/iframe&gt;
    | &lt;/div&gt;

产地:

<div class="container"> <iframe src="http://ea-studio.forexsb.com" style="width: 100%; min-height: 1500px" > </iframe> </div>

1 个答案:

答案 0 :(得分:2)

这对我有用:

p.
  Copy and paste the following HTML code in a web page.

pre
  code
    | &lt;div class="container">
    |    &lt;iframe src="http://ea-studio.forexsb.com"
    |         style="width: 100%; min-height: 1500px">
    |    &lt;/iframe>
    | &lt;/div>

enter image description here

http://codepen.io/antibland/pen/wGOeeo?editors=1000