开发者

inserting blocks of text in haml

开发者 https://www.devze.com 2023-01-14 10:17 出处:网络
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. :pres

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

精彩评论

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