-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
same named block in nesting extends file #2436
Comments
Did it have the same behaviour in jade 1.11? I've tried to keep consistency with the quirks of jade for this first release, and then change to something more clear and well defined in v3. |
@ForbesLindesay I test the case in Jade, It is rendered |
With pug 2.0.0-beta4, and these files: //- a.pug
extend b.pug
block a
| a
//- cat b.pug
extend c.pug
block a
| b
//- cat c.pug
block a
| c and pug.renderFile('a.pug') The result is
Try updating your Pug version. |
@TimothyGu that is not the problem. I test the case with //- main.pug
extends main_base.pug
block a
| Main A
block b
include other.pug
//- other.pug
extends other_base.pug
block a // this block is extends from other_base.pug, but with the same name in main_base.pug
| Other A I think it will render
but the result is
and I also test with
|
@ForbesLindesay OK, I will create a PR. |
Hi, I'm about to implement named block in https://github.com/phug-php/phug (the PHP port of Pug that will both replace pug-php and tale-jade). Is everyone agree the expected behaviour is:
As in the unit test Secbone suggest. So if it's planned to be fixed before 2.0.0 release, I will yet implement it the Secbone way in our PHP project. Thanks, |
@kylekatarnls yes, I agree that should be the output in this instance. I propose the following rule: If an included template uses Does this make sense to people? The consequence of that is that: layout.pug h1 layout
block foo page.pug extends layout.pug
block foo
h2 page text
block widgets
include widget.pug widget.pug (note no block foo
h3 widget text would produce: <h1>layout </h1>
<h3>widget text</h3>" |
page.pug
widget.pug
the block
foo
inpage.pug
will be<h3>widget text</h3>
.pug 2.0.0-alpha3
is this a bug?
The text was updated successfully, but these errors were encountered: