2013-03-28 76 views
3

新修身問題苗條 - 文字不會被識別爲標籤

我期待下面的修身模板

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> 

爲什麼跨度被視爲文本而不是標籤?

感謝

回答

7

修身處理您的span爲文本,因爲你開始在同一條直線上段的實際內容。你應該巢管道(|)的文本,其後添加跨度像這樣:

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>