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
- Add test for https://github.com/pug-php/pug/issues/204 — committed to phug-php/renderer by kylekatarnls 6 years ago
- Fix https://github.com/pug-php/pug/issues/204 — committed to phug-php/formatter by kylekatarnls 6 years ago
- Fix https://github.com/pug-php/pug/issues/204 — committed to phug-php/formatter by kylekatarnls 6 years ago
- Fix https://github.com/pug-php/pug/issues/204 — committed to phug-php/renderer by kylekatarnls 6 years ago
- Add test for nested scope (#27) * Add test for https://github.com/pug-php/pug/issues/204 — committed to phug-php/renderer by kylekatarnls 6 years ago
- Propagate scoped variables even from within the template https://github.com/pug-php/pug/issues/204 — committed to phug-php/formatter by kylekatarnls 5 years ago
The documentation is open-source and written in markdown, you can make a proposal.