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

标签 html node.js twitter-bootstrap pug

我将 Jade 与 Node js 结合使用,并希望在 Bootstrap 网页中显示 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>

最佳答案

这对我有用:

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

关于html - 如何用 Jade 显示多行 HTML 代码块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37155095/

相关文章:

node.js - 如何使用 mocha 测试我的 express 应用程序?

jquery - Bootstrap 3 模式对话框未按应有的方式呈现

html - 全局门户网站规则和可访问性规则?

html - Owl Carousel : first slide not trigger action

javascript - HTML5页面底贴

html - 在 Bootstrap 中创建水平菜单栏

twitter-bootstrap - 显示成功警报后如何关闭 Bootstrap 模式并重定向

css - 嵌套 <article> 和 <h1> 标签?

node.js - Nodejs Protractor + Jasmine + JUnitXmlReporter 运行测试但不等待浏览器

javascript - Nodejs 中的 Github 后接收 Hook