Closed radiocity closed 6 years ago
Hello,
I encountered an issue with the following code:
a.footer-group-link( href = row.url, target = row.is_blank ? '_blank' : null, rel = row.nofollow ? 'nofollow' : null, ) !{row.title}
I expected to get a link tag with optional attributes
But I actually get:
ErrorException [ Parse Error ]: syntax error, unexpected ')' /www/vendor/phug/renderer/src/Phug/Renderer/Adapter/EvalAdapter.php(12) : eval()'d code [ 2128 ]
pug-php/pug requires ternary conditional operator to be defined inside brackets, but pugjs ignores brackets at all. So, following code would work with both libraries:
a.footer-group-link( href = row.url, target = (row.is_blank ? '_blank' : null), rel = (row.nofollow ? 'nofollow' : null), ) !{row.title}
Thanks!
Fixed via phug/lexer 0.5.29, you can run composer update to get it working without brackets.
composer update
Hello,
I encountered an issue with the following code:
I expected to get a link tag with optional attributes
But I actually get:
pug-php/pug requires ternary conditional operator to be defined inside brackets, but pugjs ignores brackets at all. So, following code would work with both libraries:
Thanks!