pug-php / pug

Pug template engine for PHP
https://www.phug-lang.com
MIT License
387 stars 42 forks source link

Space in expression #218

Closed char101 closed 5 years ago

char101 commented 5 years ago

Hello,

I encountered an issue with the following code:

a.nav-link(href='', class=$ssid == $current_ssid ? 'active' : null)= $ssid

I expected to get:

<li class="nav-item"><a class="nav-link active" href="">SSID</a></li>

But I actually get:

<li class="nav-item"><a class="nav-link SSID" href="" $current_ssid ? 'active' : null>SSID</a></li>

Thanks!

It works if there is no spaces around == though:

a.nav-link(href='', class=$ssid==$current_ssid ? 'active' : null)= $ssid
kylekatarnls commented 5 years ago

Run composer update to get phug/lexer 0.5.31 that fixes this bug.