mustache / mustache.github.com

The {{official}} website
http://mustache.github.io/
Other
2.33k stars 293 forks source link

Optional variables #101

Closed walec51 closed 11 months ago

walec51 commented 7 years ago

Many mustache implementations throw an error if a referenced variable has a null value. However this is z common case: print the value if it is not null. Now we can handle this by the following syntax:

{{#someVariableA}}{{.}}{{/someVariableA}}

I suggest to introduce the following syntax sugar to replace the following:

{{?someVariableA}}

jgonggrijp commented 11 months ago

Closing this because this repository is about the website and not about the Mustache template language. Please take comments about the template language to https://github.com/mustache/spec/discussions.