如何在Jade中生成此HTML

时间:2012-06-14 18:47:49

标签: node.js express pug

如何使用Jade生成此HTML

<a class="btn btn-primary btn-large" data-toggle="modal" href="#websiteModal">
<i class=" icon-map-marker icon-white"></i>
Configure for Website</a>

我试过

a.btn.btn-primary.btn-large(data-toggle="modal",href="#websiteModal") Configure for Website
                i.icon-map-marker.icon-white

但它将<i>置于“配置网站”文本之后。

1 个答案:

答案 0 :(得分:3)

您可以这样做:

a.btn.btn-primary.btn-large(data-toggle="modal",href="#websiteModal")
  i.icon-map-marker.icon-white
  | Configure for Website

或者如果你感觉很好看:

a.btn.btn-primary.btn-large(data-toggle="modal",href="#websiteModal")='Configure for Website'
  i.icon-map-marker.icon-white