2013-04-30 5 views
9

私はhtml2haml.heroku.comを使用し、それが次のようにいくつかの通常の文字列を回し:succeed呼び出しは不要と思われるhamlでなぜ「成功する」を使用しますか?

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

。これはhtmlからhamlへの変換のアーティファクトですか?

答えて

12

あなたは

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

+0

良い点で私の(後半)の回答を参照してください!また、単語の一部をフォーマットする場合は、例えば 'piece meal'とし、 'succeed'を呼び出すと' piece 'と' meal 'の間のスペースができなくなります。 –

関連する問題