Comments (5)
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
from mason.
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.
from mason.
@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.
from mason.
@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.
from mason.
@felangel any thoughts? How should we move forward here 🙌 👀
from mason.
Related Issues (20)
- fix: allow `confirm` to only accept 'y' or 'n' as input
- fix: Misleading message when running make and having an invalid path brick globally HOT 1
- feat: include `--set-exit-if-changed` for `mason bundle` HOT 1
- logger.prompt with defaultValue if no input is provided, keeps waiting until we provide some input in Windows Powershell HOT 2
- fix: allow bundling path dependencies that are not within hook path
- fix: capture ProcessException when hook generation fails due to `dart pub get`
- chore: `mason_logger` - update win32 package HOT 2
- feat: support conditional prompting for variables HOT 6
- feat: include `prompt` style in `LogTheme`
- feat: hook resource sharing
- perf: Generating files from a list which is not a simple string rather a List<Map<String, dynamic>> takes over 30 minutes HOT 2
- feat: simplify relying on defaults when using `mason make` in CI HOT 2
- fix: Generating files from array not working HOT 6
- fix: Crash with "StreamSink is bound to stream" HOT 5
- fix: mason_logger does not handle `stdin.hasTerminal` being false
- fix: The getter 'STD_HANDLE' isn't defined for the class 'WindowsTerminal'. HOT 8
- Failing to activate mason_cli after upgrading to mason_cli: ^0.1.0-dev.54 HOT 1
- feat: set default output directory HOT 2
- feat: ask to overwrite or not for duplicate brick name
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mason.