Skip to content

Block behaviour has changed in extensions between v2.0.0-beta6 and beta11 #2747

@mrsimonemms

Description

@mrsimonemms

The behaviour of blocks has changed and can't seem to find this change documented, so wanted to work out how to get the old behaviour.

When extending something with a block, previously I could declare the block and then reuse it infinitely - this was very useful when having a "content" block as each template would just declare an area where to put it.

This is my example:

base.pug

doctype html
html
    body
        div hello
        block content

default.pug

extends ./base.pug

block content
    div header
    .content
        block content
     div footer

index.pug

extends ./default.pug

block content
    b hello world

In 2.0.0-beta6, this would get compiled to:

<!DOCTYPE html>
<html>
  <body>
    <div>header</div>
    <div class="content"><b>hello world</b></div>
    <div>footer</div>
  </body>
</html>

However, in 2.0.0-beta11, this gets compiled to:

<!DOCTYPE html>
<html>
  <body>
    <div class="content"><b>hello world</b></div>
  </body>
</html>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions