2

已经得到以下 HAML 代码,结合 Markdown:

%h2.slogan.align-center
  :markdown
    No more big words. Enough of the abbreviations.  
    **Project management for the rest of us.**

生成HTML:

<h2 class='slogan align-center'>
  <p>No more big words. Enough of the abbreviations.<br/>
  <strong>Project management for the rest of us.</strong></p>
</h2>

我希望 HTML 看起来像(省略周围的<p>标签):

<h2 class='slogan align-center'>
  No more big words. Enough of the abbreviations.<br/>
  <strong>Project management for the rest of us.</strong>
</h2>

创建该 HTML 的 HAML/Markdown 是什么?

4

1 回答 1

3

好吧,只用haml很容易:

%h2.slogan.align-center
  No more big words. Enough of the abbreviations.
  %br/
  %strong Project management for the rest of us.

好像haml的markdown插件加了p标签。根据文档,这是通过使用 4 个不同的降价处理器之一来完成的。我想结果可能会有所不同,具体取决于您使用的是哪一个。

于 2012-09-17T07:45:08.060 回答