Closed esiao closed 8 years ago
This seem to only happen with prettyprint setting to true. I will try to fix it but meanwhile you can set this option to false (it can also be caused by phpSingleLine if you set it to true).
It's strange because I didn't pass any other options than the basedir to pug. And it's set to false by default for both of this options. Anyway for now my fix is to trim the variables coming from there nothing problematic and if you update it won't conflict.
Maybe it's only fixed on my dev branch (I tested it on js-phpize that will be soon merged). But are you sure your value $bar->foo
does not contains any trailing spaces in the first place?
Yes if I use =$foo->bar
it returns "Hello World"
. I did some more tests and it's actually linked to the fact it's inside the Javascript block.
So
p #{$foo->bar}/test
Will output 'Hello world/test'
But
script #{$foo->bar}/test
Will output 'Hello world /test'
Thanks a lot for this big clue. I confirm the bug, it will be fixed soon.
Fixed and merged in Version 2.4.0.
Hello, might be related to the other issue also but if I use this notation
The content is outputted like so
'Hello world '
. It's not really problematic as I remove the space later in Javascript (the goal is to pass variables).But when trying to concatenate to get a file url it can become problematic. Something along the lines of
'#{base}/file.png'
even if here I use the notation$base.'/file.png'
as a workaround.Maybe it's related to the other issue I raised? Thanks in advance, hope it's nothing too hard to fix.