-
-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Extra line with condition statement #1253
Comments
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
is not the same as :
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 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
The text was updated successfully, but these errors were encountered: