Created
January 21, 2015 04:46
-
-
Save HerringtonDarkholme/7b1522575f5e58e5e077 to your computer and use it in GitHub Desktop.
Jade: block statement in included components
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
block append test | |
h1 from comp1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
block append test | |
h1 from comp2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
block test | |
p begin of test | |
h1 from layout | |
block main | |
p from layout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p>begin of test</p> | |
<h1>from layout</h1> | |
<h2>from comp2</h2> | |
<h1>from comp1</h1> | |
<h2>from view</h2> | |
<p>beging of main</p> | |
<h1>from comp1</h1> | |
<h2>from view</h2> | |
<h2>from comp2</h2> | |
<h1>from comp1</h1> | |
<h2>from view</h2> | |
<p>end of main</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p>begin of test</p> | |
<h1>from layout</h1> | |
<h2>from view</h2> | |
<p>beging of main</p> | |
<h1>from comp1</h1> | |
<h2>from view</h2> | |
<h2>from comp2</h2> | |
<h2>from view</h2> | |
<p>end of main</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends layout | |
block append test | |
h2 from view | |
block main | |
p beging of main | |
include comp1 | |
include comp2 | |
p end of main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using
block
ininclude
jade file is undefined behavior, according to the spec(or introduction) in jade-lang.In jade1.9, content in
block append ...
section appears in the corresponding block section in layout, and at the same time appears immediately after theblock append
section.In previous Jade(personally I tested 1.5) and php dialect, content in
block append ...
only appears at where it is defined but not inserted into its corresponding block section in layout.