Closed iax7 closed 10 months ago
That an is interesting proposal to my eyes. I'll add it in my implementation but not with the char =. I think that the char , is a better choice. It will be {{,,}} or {{,;}} or {{, }}.
There's currently nowhere in the mustache spec where something typed inside curly brackets is printed. Using a comma that's inside a tag like this is akin to using a function or variable name to decide what to print, rather than passing data like a string :)
To be consistent, it should probably have the value between matched tags, the way sections, blocks, etc work.
Agreed.
I had a ideas about putting the data to print between {{,}} and the closing enumeration {{/...}} but it seems more complicated to implement because it currently doesn't enforce restriction on the enclosed content.
I also mind about specifying the separator in {{/....}} like in {{,,/...}} or {{/...,,}} but it raise escaping issues.
No solution here?
It is a classic problem, that makes people to abandon Mustache.
See it is related to issue #140
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.
Previous discussions about this particular topic can be found via https://github.com/mustache/spec/discussions/163, https://github.com/mustache/spec/discussions/153 and https://github.com/mustache/spec/discussions/164.
When working with lists, sometimes you need to have a delimiter character like a comma, to separate them, but when the last item is rendered that comma should not be added.
I'm thinking in something like this as a starting point:
the
{{=,}}
is the delimiting character that should be used when is not the last item.