4

スリムの新しい質問

次のスリムなテンプレートを期待していました

div class="header"
h2  slim head 
p a test example of 
    span Slim 
span a new line with span
p 
    | expected a test example of <span>Slim</span>

引き起こす:

<div class="header">
<h2> slim head </h2>
    <p>a test example of <span>Slim</span></p>
    <span>a new line with span</span>
    <p>expected a test example of <span>Slim</span></p>
</div>

しかし代わりに、span タグが認識されず、次のように生成されました。

<div class="header">
  <h2> slim head </h2>
  <p>a test example of 
         span Slim </p>
  <span>a new line with span</span>
  <p>expected a test example of <span>Slim</span></p>
</div>

スパンがタグではなくテキストとして扱われたのはなぜですか?

ありがとう

4

1 に答える 1

8

span同じ行で段落の実際のコンテンツを開始したため、Slim はテキストとして扱います。次のように、テキストをパイプ ( |) でネストし、その後にスパンを追加する必要があります。

div class="header"
h2  slim head 
p 
    | a test example of 
    span Slim 
span a new line with span
p 
    | expected a test example of <span>Slim</span>

これは次のように正しくコンパイルされます。

<div class="header">
  <h2> slim head </h2>
  <p>a test example of <span> Slim</span></p>
  <span>a new line with span</span>
  <p>expected a test example of <span>Slim</span></p>
</div>
于 2013-05-11T07:54:16.237 に答える