CFE-3489: Mustache: Added warning when trying to use {{.}} to expand containers #97
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Example:
The mustache manual doesn't mention
{{.}}
at all:http://mustache.github.io/mustache.5.html
Mustache.js documentation does mention it:
https://github.com/janl/mustache.js/#non-empty-lists
But only what it should do when iterating over a list of strings.
Some references in the "spec":
mustache/mustache#129
https://github.com/mustache/spec/blob/master/specs/sections.yml#L141-L169
But no mention of what should happen in these edge cases / wrong usage.
So, I don't think we should copy the behavior of the mustache demo in this case, because
Mustache template
Data:
Output:
JavaScript:
See JIRA tickets for further explanation:
https://tracker.mender.io/browse/CFE-3457
https://tracker.mender.io/browse/CFE-3489