pug: Unexpected override occerd in block scopes

Hi, I encountered an issue with the following code:

data

array(
  'text' => '2',
)

pug

mixin paragraph(text)
  p= text
  block
  
doctype html
html
  body
    +paragraph('1')
      +paragraph(text)
    +paragraph(text)

I expected to get:

<!DOCTYPE html>
<html>
  <body>
    <p>1</p>
    <p>2</p>
    <p>2</p>
  </body>
</html>

But I actually get:

<!DOCTYPE html>
<html>
  <body>
    <p>1</p>
    <p>1</p>
    <p>2</p>
  </body>
</html>

php-pug(3.2.0) will fail, but pugjs will success.

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 29 (14 by maintainers)

Commits related to this issue

Most upvoted comments

The documentation is open-source and written in markdown, you can make a proposal.