phug-php / phug

Phug - The Pug Template Engine for PHP
https://phug.selfbuild.fr
MIT License
63 stars 3 forks source link

Array access in multiline attributes #28

Closed rodion-k closed 6 years ago

rodion-k commented 6 years ago

Hello,

I encountered an issue with the following code:

- $test=['id' => 1]
p(
  id=$test['id']
) test

I expected to get:

<p id="1">test</p>

But I actually get: rendering hangs

Thanks!

rodion-k commented 6 years ago

this loop never ends

kylekatarnls commented 6 years ago

With which pug code?

rodion-k commented 6 years ago
- $test=['id' => 1]
p(
  id=$test['id']
) test
kylekatarnls commented 6 years ago

Oh OK, you found the cause of the hang, awesome! Thanks. Could be quick fixed now.

rodion-k commented 6 years ago

And another error with attributes:

- $test=1
p(
  id=empty($test) ? '' : $test
) test

PHP Parse error: syntax error, unexpected ')' in /vendor/phug/renderer/src/Phug/Renderer/Adapter/EvalAdapter.php(12) : eval()'d code on line 207

kylekatarnls commented 6 years ago

Hi, please run composer update, it should be fixed.