为什么在haml中使用'success do'?

时间:2013-04-30 02:21:13

标签: haml

我使用了html2haml.heroku.com,它将一些普通字符串转换为以下内容:

A normal sentence is here
= succeed '.' do
  %strong and it is cut off randomly by this succeed

succeed来电似乎没必要。这只是从html到haml转换的工件吗?

1 个答案:

答案 0 :(得分:16)

如果您尝试

A normal sentence is here
= succeed '.' do
  %strong and it is cut off randomly by this succeed

并生成HTML,输出将如下:

A normal sentence is here
<strong>and it is cut off randomly by this succeed</strong>.

但是,如果您尝试类似

的内容
A normal sentence is here
%strong and it is cut off randomly by this succeed
.

您将获得如下输出:

A normal sentence is here
<strong>and it is cut off randomly by this succeed</strong>
.

空格在内联元素中非常重要 - 请参阅this question

中的我(迟到)答案