Open Pierre-Monier opened 9 months ago
Hi @Pierre-Monier !
You can already solve this by not including the new line:
{{^publish}}publish_to: none{{/publish}}
dependencies:
flutter:
sdk: flutter{{#useGoogleFonts}}
google_fonts: latest{{/useGoogleFonts}}
Alternatively, you can use Mustache comments to escape the line break:
{{^publish}}publish_to: none{{/publish}}
dependencies:
flutter:
sdk: flutter
{{#useGoogleFonts}}{{!
}} google_fonts: latest{{!
}}{{/useGoogleFonts}}
In my honest opinion, I think both solutions hinder readability and I would like an option that doesn't hinder the readability as much. Although, a solution that does so may start to deviate from the Mustache specification. I wonder about @felangel thoughts on this.
Thanks for coming back !
Yes, your workaround works, but I'm in a very specific case where I will be very happy that it works as explain in the documentation :).
Also, according to the mustache specification, it should work as I describe
You can see that
Hello Chris
You have just won 10000 dollars!
Well, 6000.0 dollars, after taxes.
is not the same as :
Hello Chris
You have just won 10000 dollars!
Well, 6000.0 dollars, after taxes.
Maybe it is an issue with mustache directly ? In that case, I can move my issue here, but I would be very surprised if it is the case
@Pierre-Monier I agree with your suggestion considering the specification example.
{{#my_var}}
hello
{{/my_var}}
Should evaluate to:
hello
If a new line is desired one would:
{{#my_var}}
hello
{{/my_var}}
This is obviously a breaking change, however, I think we should go forward with it if the specification details so.
@alestiago Sounds great!
Since this is a breaking change, it might be a good occasion to change the conditional syntax, like describe in this issue. I think this new syntax will be a huge improvement.
@felangel any thoughts? How should we move forward here 🙌 👀
Description According to the documentation, this :
with the following configuration :
should generate this :
But in reality, what it generates is the following :
As you can see, there is some extra space.
Steps To Reproduce
mason get && mason make demo -c config.json -o ./output
./output/HELLO.md
Expected Behavior
The generated file should have no extra space, as described in the doc