开发者

inserting blocks of text in haml

In my Jekyll blog I use the include tag to put the contents of a file into the document. However if I attempt to do this with a HAML based document the indentation of the included text is wrong. :preserve does not work because it requires indentation. Is there a way to specify a block of text without depending on indentation?

%html
  %body
 开发者_运维知识库   - preserve do
<strong>included text from file</strong>
    - end


It seems that in current version of Haml :text filter was removed. Now you can use :plain filter. No processing is performed for the text inside this block. You can paste multiline blocks of text or HTML code there. HTML will appear on the page unescaped.

:plain
  Some text <b>or HTML</b>.


For text, use filters:

:text
  some text
:erb
  <%= render :partial ... %>

http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html#filters

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜