Open tredoe opened 13 years ago
Thanks for reporting this. I actually didn't know this feature existed!
Just pushed some initial code that should support most cases, though I still need to add support for zero-length arrays or slices.
Hoisie thanks for add it so fast.
But I get: line 7: unmatched close tag
Note that 'use-email' has 'true' as value: http://github.com/kless/goweb-identity/blob/2197ffa784e0ec356ac57486bd446f6c1bf5f99e/identity/view.go#L25
Ugh, this is probably related to the change in strings.Split
Sorry! The problem was because I re-compiled Go and goinstalled mustache but I didn't update it, so I could not use the inverted section.
Anyway, with the last change in strings.Split(), there would change the '0' to '-1'.
http://groups.google.com/group/golang-nuts/browse_thread/thread/efc6eca11122105e/c36738bc8339ba0b
I'm testing it and the code inner of the inverted section is always rendered, when I've passed a key to "false", "" (empty), and without the key.
"While sections can be used to render text one or more times based on the value of the key, inverted sections may render text once based on the inverse value of the key. That is, they will be rendered if the key doesn't exist, is false, or is an empty list."
Ah, I ran into the issue you were having. It should be fixed now. Care to test again?
Hi! There is a useful section that has not been implemented. The Inverted Sections which begins with a caret (hat) and ends with a slash.
http://mustache.github.com/mustache.5.html