0
SlideBase.jade玉延長和包括覆蓋文件無故
.slideWrap
.slideInner
block slides
slideSet1.jade
extends SlideBase
append slides
.slide set1slide1
.slide set1slide2
.slide set1slide3
slideSet2.jade
extends SlideBase
append slides
.slide set2slide1
.slide set2slide2
.slide set2slide3
output.jade
#mySlides
p some copy
#slideZone
include slideSet1.jade
include slideSet2.jade
預期的結果:
<div id="mySlides>
<p>some copy</p>
<div id="slideZone>
<div class="slideWrap>
<div class="slideInner>
<div class="slide">set1slide1</div>
<div class="slide">set1slide2</div>
<div class="slide">set1slide3</div>
</div>
</div>
<div class="slideWrap>
<div class="slideInner>
<div class="slide">set2slide1</div>
<div class="slide">set2slide2</div>
<div class="slide">set2slide3</div>
</div>
</div>
</div>
</div>
實際結果:
<div id="mySlides>
<p>some copy</p>
<div id="slideZone>
<div class="slideWrap>
<div class="slideInner>
<div class="slide">set1slide1</div>
<div class="slide">set1slide2</div>
<div class="slide">set1slide3</div>
</div>
</div>
<div class="slideWrap>
<div class="slideInner>
<div class="slide">set1slide1</div>
<div class="slide">set1slide2</div>
<div class="slide">set1slide3</div>
</div>
</div>
</div>
</div>
而不是越來越slideSet2.jade,玉編譯只是重複slideSet1.jade在它的位置。我在這裏做錯了什麼?
披露:
我上Codekit運行與玉版本0.27.2;而且任何被接受的答案都能解釋爲什麼它不適合我的環境。
我得到了相同的結果,我想你已經發現了一個錯誤。我把它編譯成JavaScript來獲得洞察力和JS確實顯示了這個bug: [67線](https://gist.github.com/4032320#L67)包含'slideSet2.jade'(文件名來打印調試信息)但[line 82](https://gist.github.com/4032320#L82)包含slideSet1.jade的內容。 – guillaume
我不太明白錯誤在哪裏。我是否應該將此報告給玉石項目或編碼器項目? – Fresheyeball
肯定是玉。你的測試用例對這個問題非常有代表性,當你包含同一個類的兩個子類時就會出現這個錯誤。我在【玉的問題(https://github.com/visionmedia/jade/issues/search?q=include)一眼,我沒有看到這個bug,但你要仔細檢查 – guillaume